Jailbroken iOS start and end call programmatically - ios

Is it possible to programmatically start and end call in jailbroken iOS using Objective-C? I know that with non-jailbroken device it is not possible (especially call ending), but I'm asking for JAILBROKEN versions.

To start a call use
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:#"tel://1273183781414"]];
To end a Call just kill "Phone" application
system("killall MobilePhone");

Related

I can't fetch data in background in iOS

My app does the intended operations when I use Simulate Background Fetch in the Debug tab in Xcode, however, when the app is running on my phone nothing works.
Has this happened to someone before? How did you resolve it?
I'm currently using Swift 2.2 and Xcode 7.3
Did you edit the schema in Run mode for the Launch due to a Background Fetch Event
iOS Background Fetch Not Working Even Though Correct Background Mode Configured
iOS won't allow any app to run in the background unless the app ask for it and it will allow it to run for 10mins only to register for background execution:
- (void)applicationDidEnterBackground:(UIApplication *)application {
UIBackgroundTaskIdentifier identifier;
identifier = [[UIApplication sharedApplication] beginBackgroundTaskWithExpirationHandler:^{
[[UIApplication sharedApplication] endBackgroundTask:identifier];
}];
}

XCUITest - How to simulate locking of the device

I am writing XCUITests for my app in Swift, and I was wondering if it's possible to simulate the locking and unlocking of a device. I've looked at XCUIApplication methods but there don't seem to be any that allow me to lock the device.
This is not possible at the moment.
According to this answer, there's a private method on XCUIDevice that you can call to lock the screen as follows:
XCUIDevice.shared.perform(NSSelectorFromString("pressLockButton"))
I'm not sure but may be it is possible to do via some magic sentence like:
let siri = XCUIDevice().XCUISiriService // available since SDK 10.3
siri.activate(voiceRecognitionText: "siri, please lock my device")

How found iPad with iOS 8 is setup Face Time

As You know by iOS 8 user can answer calls in iPad.
In older version I was checking call ability by this code:
[[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:#"tel:+11111"]]
But in iOs 8, this method returns true! I have 2 questions about this feature:
Really I can make call from application by iPad?
How can I check if user did not setup face time account?

IOS application - reopen application from background mode

Is there a way to reopen my application from background mode ?
No. It is not possible to open an app automatically. However, you can use notifications to let user know about some event related to your app.
Technically it's actually possible but only on jailbroken devices. Use the following function from the SpringBoardServices framework:
SBSLaunchApplicationWithIdentifier(CFSTR("com.mycompany.bundleid"), NO);
On non-jailbroken devices, it's not really possible.

Showing EULA when app starts and quiting if user doesn't accept it

I must show EULA on the first launch. I want to close the app if user doesn't accept it. What is the proper way to do it so that the app will be accepted to app store?
I read that using exit(0) and [[UIApplication sharedApplication] terminate] is not the way to go.
Apple doesn't want you to exit the app because it looks like a crash. That is why they made -[UIApplication terminate] private and will reject your app if you use it. They don't seem to reject apps that use exit and I've seen apps exit themselves but I agree with Apple that it's not good UI behavior on iOS, it does indeed feel strange if you get thrown back to the home screen without having pressed the home button. So I recommend you simply show a screen with a message along the lines of "You cannot use the app without accepting the EULA. Either accept the EULA or press the Home button".
You can suspend the app and it gives the appearance that the app is closing.
UIApplication *app = [UIApplication sharedApplication];
[app performSelector:#selector(suspend)];

Resources