You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Aleksey Dobrushin (JIRA)" <ji...@apache.org> on 2014/10/27 14:47:34 UTC
[jira] [Commented] (CB-7865) [Contacts] pickContact does not return
contact id and photo
[ https://issues.apache.org/jira/browse/CB-7865?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14185134#comment-14185134 ]
Aleksey Dobrushin commented on CB-7865:
---------------------------------------
Found the solution, but I think it should be the part of plugin.
following code should be added to initWithWebView function:
{code}
if (ABAddressBookGetAuthorizationStatus() == kABAuthorizationStatusNotDetermined) {
ABAddressBookRequestAccessWithCompletion(addressBookRef, ^(bool granted, CFErrorRef error) {
if (granted) {
// If the app is authorized to access the first time then add the contact
} else {
// Show an alert here if user denies access telling that the contact cannot be added because you didn't allow it to access the contacts
}
});
}
{code}
Without this code if you look at permissions for your application Contacts is not listed. This is of course nice change from iOS that contact picker could work without having access to Contacts (sounds strange), but picker returns only copy of the contact record, without id and image data.
Please note, if you have app previously installed on iPad, it remembers contact could be accessed from app. But in my case - new iPad and newly installed application - now it should request access to Contacts.
> [Contacts] pickContact does not return contact id and photo
> -----------------------------------------------------------
>
> Key: CB-7865
> URL: https://issues.apache.org/jira/browse/CB-7865
> Project: Apache Cordova
> Issue Type: Bug
> Components: iOS
> Affects Versions: 3.5.0
> Environment: MacOS, XCode, iPad3 with iOS 8.0.2
> Reporter: Aleksey Dobrushin
>
> pickContact function of Contact plugin does not return contact image (photo) and id.
> I did some debugging - didSelectPerson handler of ABPeoplePickerNavigationController:
> - ABRecordGetRecordID(person) returns always -1
> - in CDVContact.extractPhotos method ABPersonHasImageData returns always false, even for contacts which has photos
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org