My iOS app needs the privilege to access pictures to run properly.
I was testing how my app was responding to changes in the privacy settings when I discovered the following: each time I go to the Settings apps and change the privacy setting for my app (either turning it on or off), my app is killed without any warning.
I found these logs in my device's console:
Apr 8 15:01:50 iPad Preferences[5924] <Warning>: ########### Quitting application (xxx) in response to privacy settings change.
Apr 8 15:01:50 iPad com.apple.launchd[1] (UIKitApplication:xxx[0xc7cb][6039]) <Notice>: (UIKitApplication:com.edupad.itoochdev[0xc7cb]) Exited: Killed: 9
Apr 8 15:01:50 iPad backboardd[30] <Warning>: Application 'UIKitApplication:xxx[0xc7cb]' exited abnormally with signal 9: Killed: 9
And though I implement applicationWillTerminate:
in my app delegate, it doesn't seem to get called before the app is killed.
I can't find any relevant documentation about what I should implement to get a notification before my app is killed. Any idea if I can solve this?
PS 1: i know i could implement applicationDidEnterBackground:
but I would like to provide a different UX in the case (A) the user just quickly switched to the Setting app to change the privacy setting or (B) the user wants to move on and won't be back to the app before a while
PS 2: if you're testing this sort of things, don't do it with your app being launched via Xcode or you'll crash with a sigkill.