avs
avs

Reputation: 47

Forcing termination of app when accepting incoming call

I need to force quit my app when I pressed the Answer button in the incoming call and when I tap on to Reject the app should continue its working.

I had tried by pacing exit(0) in applicationDidEnterBackground.

The app is force quitting . but the problem is its relaunching automatically by itself.

Any suggestion and Ideas??

Upvotes: 2

Views: 295

Answers (1)

Michael Dautermann
Michael Dautermann

Reputation: 89509

Never ever call "exit" within your app code. Apple WILL reject apps that quit out on their own, where the user isn't doing it explicitly. Apple says as much in their "iOS Human Interface Guidelines" (look in the "Don't Quit Programatically" section)

The only official & approved way to quit an app is for the user to manually do it by tapping on the home bar button and then hitting the "-" badge on the shaking apps in the "mini" dock.

I'd say the only thing you should do in this case is handle things properly in the applicationWillResignActive: app delegate method.

Upvotes: 4

Related Questions