Toggling Privacy settings will kill the app
the OS sends a SIGKILL which is not a crash - Apple session on privacy in iOS6 says:
- If permissions changes, app is quit.
- Background task expiration handler is called, if registered
- iOS then kills the application.
WWDC 2012 Session Videos: Privacy Support in iOS and OS X
Expiration handler: beginBackgroundTaskWithExpirationHandler
There is no way around this I can see.
Watch App get killed while allowing/disallowing camera permission on iPhone App
Your app is not crashing its just forced to restart by WatchOS with new privacy settings. So when you change the any permission in iPhone then it means privacy policy changed, so app will be killed if its attached to debugger else it will relaunch. its happing on both Apple Watch and iPhone. if you change the permission in Apple Watch iOS app will restart. if you change the permission in iOS app Apple Watch app will be restart.
Also, Not only camera permission If the user at some point changes the Address Book, Calendars, Reminders, Camera, or Photos permissions, WatchOS app will SIGKILL the app when change App permission in iPhone. (it's default behaviour of iOS and WatchOS)
Please refer the below links
App killed by SIGKILL when changing privacy settings ,
https://developer.apple.com/forums/thread/64740,
App crashes in background while changing permission - swift,
App crashed in iOS 6 when user changes Contacts access permissions
App killed by SIGKILL when changing privacy settings
I think it is a bug or at least poorly documented and unexpected behavior. But it does not crash it is just forced to restart. You will get a SIGKILL message but no Crash log.
If you are a registered apple developer you can check their forums for discussions about this issue
- https://devforums.apple.com/message/715855
- https://devforums.apple.com/message/714178
I don't know of any way how to prevent this behavior but feel free to file a bug report with apple. It is rumored they use bug duplicates as a way of measuring the bug severity.
Maybe you can store your app state in order to restore it when it restarts.
App crashes in background while changing permission - swift
Your app is not crashing its just forced to restart by iOS with new privacy settings. So when you change the camera permission then it means privacy policy changed, so app will be killed if its attached to debugger else it will relaunch.
Also, Not only camera permission If the user at some point changes the Address Book, Calendars, Reminders, Camera, or Photos permissions, iOS will SIGKILL the app. (it's default behaviour of iOS)
App crash when change permission AddressBook in Settings
Your app is not crashing its just forced to restart by iOS with new privacy settings. So when you change the privacy policy, app will be killed if its attached to debugger else it will restart or relaunch.
Note : If the user at some point changes the Address Book, Calendars, Reminders, Camera, or Photos permissions, iOS will SIGKILL
the app. (It's not crash it's default behaviour of iOS)
iOS Terminated due to signal 9 on allowing permission
Your app is not crashing its just forced to restart by iOS with new privacy settings. iOS will SIGKILL the app. (it's default behaviour of iOS). You can checkout - WWDC 2012 Session Videos: Privacy Support in iOS and OS X for more info on this.
This does not hold true for Location permissions.
App is forced to restart by iOS with new privacy settings
This is not a problem of your application. Its just the way apple designed iOS. iOS will terminate the application when user change certain permissions of it.
Actually you will get a SIGKILL message but no Crash log when toggling settings. In this situation even applicationWillTerminate
not get called!
So the answer is you can't fix it.
Look at page 24 of this slide
Related Topics
Method Overloading in Objective-C
Attempt to Insert Non-Property List Object When Trying to Save a Custom Object in Swift 3
Navigation Bar Rightbaritem Image-Button Bug iOS 11
Add Bottom Border Line to UI Textfield View in Swiftui/Swift/Objective-C/Xamarin
Converting iPhone Xib to iPad Xib
Instruments Allocations Track Alloc and Dealloc of Objects of User Defined Classes
How to Use Avcapturephotooutput
Disable Uipageviewcontroller Bounce
How to Access Own Window Within Swiftui View
++ Is Deprecated It Will Be Removed in Swift 3
Nsxmlparser on iOS, How to Use It Given a Xml File
How to Detect When Keyboard Is Shown and Hidden
iPhone Sdk Cgaffinetransform Getting the Angle of Rotation of an Object
How to Create IPA in Xcode 6 Without Apple Developer Account
High Quality Scaling of Uiimage
Swift 3.0 Error: Escaping Closures Can Only Capture Inout Parameters Explicitly by Value