문제

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.

도움이 되었습니까?

해결책

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

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top