Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Crash when Calendar permission changes outside iOS app

I'm integrating EventKit in an iOS app, but I am experiencing a weird crash which I'm not able to debug.

In the app I've got a UISwitch which enables Calendar-related functionality. When the switch is switched on for the first time, the app requests Calendar authorization, which works fine. If you then switch to the Settings app (with the app still running in the background) and disable Calendar authorization, the app crashes on the background with a Message from debugger: Terminated due to signal 9 without any further information. This happens on both the simulator (iPhone X, iOS 11.2; iPhone 6s, iOS 11.0.1) and my phone (iPhone X, iOS 11.2.6).

It also happens the other way around: when authorization is not given (.denied) I redirect the user to the Settings app. When the user then switches on the Calendar authorization, the app crashes with the same message.

Example code: https://gist.github.com/rbresjer/4e971c0650e63a53bd81056e962c121b

My project contains a valid Info.plist file with the relevant privacy description for calendar usage.

Any ideas?

like image 787
Rutger Bresjer Avatar asked Oct 20 '25 20:10

Rutger Bresjer


1 Answers

It is an expected behaviour for iOS, when you change its permissions in settings. If the app was opened, the system will send "Message from debugger: Terminated due to signal 9" and the user has to start app manually again.

And I believe there are many similar questions on SO. Like this: App crashes in background while changing permission - swift

like image 199
T. Pasichnyk Avatar answered Oct 23 '25 11:10

T. Pasichnyk



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!