[TIMOB-24729] iOS: Resolve iOS 8 deprecations for ABPeoplePickerNavigationController
| GitHub Issue | n/a |
|---|---|
| Type | Story |
| Priority | High |
| Status | Closed |
| Resolution | Fixed |
| Resolution Date | 2017-06-19T15:19:35.000+0000 |
| Affected Version/s | n/a |
| Fix Version/s | Release 6.2.0 |
| Components | iOS |
| Labels | qe-6.2.0 |
| Reporter | Vijay Singh |
| Assignee | Vijay Singh |
| Created | 2017-05-24T04:14:18.000+0000 |
| Updated | 2017-06-20T15:15:56.000+0000 |
Description
In SDK 6.0.0, we updated the default minimum iOS target to 8.0 as a result of the Xcode 8.x version that is now supported. Doing that, our iOS SDK core shows some deprecation-warnings regarding API's that should be replaced in iOS 8 and later.
Replace ABPeoplePickerNavigationController (in Ti.Contacts, replacement straight forward)
This is subset of ticket TIMOB-24335.
PR: https://github.com/appcelerator/titanium_mobile/pull/9080 Test Case:
NOTE : Please verify it for iOS < 9 also.var win = Ti.UI.createWindow({ backgroundColor: '#fff' }); var btn = Ti.UI.createButton({ title: 'Open Contact' }); var performAddressBookFunction = function(){ Ti.Contacts.showContacts({ cancel:function(e) { Ti.API.info('cancel called'); }, // Comment selectedPerson block to verify selected property selectedPerson:function(e){ Ti.API.info('selected person called' +e.person); Ti.API.info(' selected person name is :' +e.person.fullName); }, selectedProperty:function(e){ Ti.API.info('selected property called'); Ti.API.info(' selected property detail is :' +JSON.stringify(e)); } }); }; var addressBookDisallowed = function(){ Ti.API.info('contact permission not allowed'); }; btn.addEventListener('click', function() { if (Ti.Contacts.hasContactsPermissions()) { performAddressBookFunction(); } else { Ti.Contacts.requestContactsPermissions(function(e) { if (e.success) { performAddressBookFunction(); } else { addressBookDisallowed(); } }); }}); win.add(btn); win.open();Verifed as fixed, ran test case against iOS8/9/10 with Ti SDK 6.1.0.GA & Master v6.2.0.v20170619134258 Tested On: iPhone 7 10.3.2 Device & Simulator iPhone 6 8.1 & 9.3 Simulator Mac OS Sierra (10.12.5) Ti SDK: 6.2.0.v20170619134258 Appc NPM: 4.2.9 App CLI: 6.2.2 Xcode 8.3.3 Node v4.6.0 *Closing ticket.*