Question

I'm creating a jailbreak tweak that includes calling from the lockscreen. I am currently using [[%c(SKTelephonyController) sharedInstance] dialNumber:number] to call a number.

Everything is working fine and the call goes through until you try to make a call when there is an open application. For example, if you leave an application open and lock the phone without closing the application, SpringBoard will crash when you try making the call. If there is no open application, the call works fine and there is no crash.

Is there a way to suspend the application programmatically?

I've already looked into [[%c(UIApplication) sharedApplication] _killThermallyActiveApplication];, but the selector is unrecognized, although it is found in the private headers. I've also tried [application disableContextHostingForRequester:@"LaunchSuspend"], which also isn't working.

I'm trying to deactivate the application before making the phone call, but after 2 days of searching through headers, I am unable to do so.

Any help is appreciated.

Was it helpful?

Solution

Finally figured it out! I'll put the code below for those who need it.

[[%c(UIApplication) sharedApplication] quitTopApplication:nil];

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top