[TIMOB-23627] Calendar, Contacts and Camera can crash on iOS 10 / Xcode 8
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2016-09-12T17:42:37.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 5.5.0 |
Components | iOS |
Labels | ios10, permissions, qe-5.5.0 |
Reporter | Hans Knöchel |
Assignee | Hans Knöchel |
Created | 2016-07-12T12:46:24.000+0000 |
Updated | 2016-09-12T18:44:43.000+0000 |
Description
Apps built with iOS 10 and Xcode 8 can crash when the user accesses different API's (Camera, Calendar & Contacts). After some research, this is because iOS 10 and later required the following keys that have been introduced back in iOS 6:
-
NSContactsUsageDescription
- NSCameraUsageDescription
- NSCalendarsUsageDescription
- NSMicrophoneUsageDescription
They are similar to the NSLocationWhenInUseUsageDescription
and NSLocationAlwaysUsageDescription
keys that need to be added to the plist. So this issue is more a docs ticket which we need to update and mention in the 6.0.0 release notes, so people know to add these keys.
Further links:
- https://developer.apple.com/library/prerelease/content/documentation/General/Reference/InfoPlistKeyReference/Articles/CocoaKeys.html
- https://forums.developer.apple.com/thread/51239
PR: https://github.com/appcelerator/titanium_mobile/pull/8130
Reopening to additionally throw a warning if users don't have the keys when using iOS 10+.
PR: https://github.com/appcelerator/titanium_mobile/pull/8181 Steps to test: 1. Run the following demo-code on iOS 9:
2. No error-logs should appear, the user should be asked for permissions like before 3. Run the same code on iOS 10 4. The app should crash when not having the required keys included 5. Include the following keys in the plist-section of your tiapp.xml:
6. Run the app on iOS 10 again 7. The app should not crash anymore and the usage-descriptions in the tiapp.xml should be displayed in the authorization-dialogs.
PR (5_5_X): https://github.com/appcelerator/titanium_mobile/pull/8222
I am getting an error on an iOS 9.3.1 and 10 device when
Request video permissions (camera, microphone & gallery)
Is clicked.Steps to reproduce.
Download SDK
5.5.0.v20160815094515
Run sample app.js above
Click
{color:red}I tested this usingRequest video permissions (camera, microphone & gallery)
6.0.0.v20160810073036
and the error was not thrown.{color}Error
{noformat} [ERROR] : Script Error { [ERROR] : column = 819; [ERROR] : line = 1; [ERROR] : message = "+[TiUtils isIOS10OrGreater]: unrecognized selector sent to class 0x10056a848"; [ERROR] : sourceURL = "file:///var/containers/Bundle/Application/5D074778-C4F2-4D20-B6DD-DDBA6A7D0243/TIMOB-23627.app/app.js"; [ERROR] : stack = "[native code]\nfile:///var/containers/Bundle/Application/5D074778-C4F2-4D20-B6DD-DDBA6A7D0243/TIMOB-23627.app/app.js:1:819"; [ERROR] : } {noformat} *Reopening*All good, that was a problem with the backport I fixed as part of https://github.com/appcelerator/titanium_mobile/pull/8227 because I hoped [~apetkov] can merge it asap. As soon as it is merged (and [this commit](https://github.com/appcelerator/titanium_mobile/pull/8227/commits/7fdd260291840f61bb678caec0b261f7357256d0)) it will work.
[~jlongton] Please try 5.5.0.v20160815115302, thanks.
Verified as fixed, thanks [~hansknoechel]
Tested on
{noformat} iPhone 6s plus (9.3.1) iPhone 6 (10.0) iPhone Simulator (10.0) Mac OSX El Capitan 10.11.6 Studio: 4.7.0.201607250649 Ti SDK: 5.5.0.v20160815115302 Appc NPM: 4.2.7 Appc CLI: 5.4.0.GA Xcode 7.3.1 Node: v4.2.2 {noformat} *Closing ticket*Small issue here: The key for Calendar permissions should be
NSCalendarsUsageDescription
notNSCalendarUsageDescription
(Calendars should be plural, not singular). So, the crash still occurs for calendars when using our advised fix. Will need a quick update on docs/release notes.Fixed on master, 6_0_X and 5_5_X, please check and close. I think the release-notes are not affected, [~bimmel] please verify we have
NSCalendarUsageDescription
and notNSCalendarsUsageDescription
.[~hans123], confirmed. The release note is in good shape.
Verified fixed, using: MacOS 10.12 (16A239m) Studio 4.7.1.201609100950 Ti SDK 5.5.0.v20160912110832 Appc NPM 4.2.7 Appc CLI 5.5.0-6 Alloy 1.9.2 Xcode 8.0 (8A218a) Calendar, Contacts, and Camera now properly throw an error indicating that the Keys must be added to the tiapp.xml. Once the keys are included, the app no longer crashes. Tested using the QE MediaModule as well as other test apps created that require different permissions.