[TIMOB-11174] iOS 6: Ti.Contacts-Module broken
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2012-10-06T02:46:21.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 2.1.3, Release 3.0.0, Sprint 2012-20 API, 2012 Sprint 20 |
Components | iOS |
Labels | api, contacts, device, ios, ios6, iphone, qe-ios6, qe-port |
Reporter | Hans Knöchel |
Assignee | Blain Hamon |
Created | 2012-09-25T16:34:44.000+0000 |
Updated | 2012-10-06T02:46:21.000+0000 |
Description
The method "getAllContacts()" of the Ti.Contacts is broken when installing the app on a device (tested with Ti-SDK 2.1.3 GM, iOS 6 and iPhone 5). It works great in the simulator but not on the given device.
*Code-Example:*
var data = [];
var contacts = Titanium.Contacts.getAllPeople();
for (var i = 0; i < contacts.length; i++) {
data.push({
name : contacts[i].firstName,
surname : contacts[i].lastName,
phone : contacts[i].phone
});
}
Ti.API.info("Collected Contacts: \n"+data);
What is the behavior you see on device? Is there just no data?
Yes, there is just returned an empty array (data). Note: After i used Ti.Contacts.showContacts(), granted the permission for the contacts and then tried it again, the data was given. So it's obviously a bug where we need to ask for permissions to access the contacts (like in the Geolocation-API).
Able to reproduce the issue on SDK : 2.1.3.v20120921190208 & Iphone 5- iOS6. It does not ask for any permissions to access contacts & we get a empty array. Also,building with iOS SDK 5.1 & titanium SDK 2.1.2 GA asks us for the permission to access the contacts. Running in simulator for iOS SDK 5.1 & titanium SDK 2.1.2 GA returns us "Collected Contacts : [objects,objects],...."
Expanded test case
Master PR https://github.com/appcelerator/titanium_mobile/pull/3078 2_1_X PR https://github.com/appcelerator/titanium_mobile/pull/3084
Verified fix with: Titanium Studio, build: 2.1.2.201208301612 Titanium SDK: 3.0.0.v20120929141713 Titanium SDK: 2.1.3.v20120928203111 Devices: iPhone4 ios5.1.1 iPhone5 ios 6.0 Closing the bug.
Reopened to adjust remaining estimate.