[AC-4506] iOS: Crashes when calling Ti.Contacts.requestAuthorization
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Resolved |
Resolution | Not Our Bug |
Resolution Date | 2016-09-25T15:42:12.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Titanium SDK & CLI |
Labels | n/a |
Reporter | Mike Neill |
Assignee | Shak Hossain |
Created | 2016-09-25T13:12:24.000+0000 |
Updated | 2016-09-25T15:42:13.000+0000 |
Description
In my application I am using the TI.Contacts framework for pulling contacts from the device. This has been working correctly, but when I updated to Titanium 5.5.0 this line started to crash. The odd thing is I do not get a stack trace or error in the debugger at all. The application simply terminates without any information regarding the crash. Has this been deprecated and I just missed it?
I also updated my code to reflect exactly what is in your documentation. This is what I have. Any thoughts as to what is wrong? Is there a framework I need to import? if (Ti.Contacts.hasContactsPermissions()) { // do some work } else { Ti.Contacts.requestContactsPermissions(function(e) { // do some work }); }
Hey Mike, iOS 10 requires the user to add usage-description keys to the plist when accessing certain platform API's. In your case, you need the following key in your plist-section of the tiapp.xml:
This is behavior we can't prevent, since iOS will crash the app intentionally. So as soon as you add the key and clean-rebuild your app, everything should be fine. Also check our [5.5.0 blog](https://www.appcelerator.com/blog/2016/09/ga-release-for-titanium-sdk-5-5-0-appcelerator-cli-5-5-0-appcelerator-studio-4-7-1/) for details on the iOS 9 > iOS 10 migration if you want. Thanks!