[ 
https://issues.apache.org/jira/browse/CB-223?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13206688#comment-13206688
 ] 

Robert La Ferla commented on CB-223:
------------------------------------

Thanks Becky.  Let me recommend a slightly different approach.  Instead of 
locating the groups/categories for a given contact (which I agree is 
inefficient for implementation reasons), a more efficient approach is a method 
that gets a list of contacts for a given group/category.  While it would be 
ideal if the individual contacts then had all the categories/groups set, they 
don't currently.  Implementing my proposal, developers will at least have one 
way to get at the group information in the main API.

These methods represent a minimum API that "augments" the existing Contacts API:

(1) get a list of groups/categories

navigator.contacts.findgroups(groupSuccess, groupError)

function onSuccess(groups) {
    alert('Found ' + groups.length + ' groups.');
};

function onError(groupError) {
    alert('onError!');
};

(2) get a list of contacts for a specific group/category.

navigator.contacts.getgroup(groupname, contactSuccess, contactError)

function onSuccess(contacts) {
    alert('Found ' + contacts.length + ' contacts.');
};

function onError(contactError) {
    alert('onError!');
};

                
> Add support for iOS contact groups
> ----------------------------------
>
>                 Key: CB-223
>                 URL: https://issues.apache.org/jira/browse/CB-223
>             Project: Apache Callback
>          Issue Type: New Feature
>          Components: iOS
>    Affects Versions: 1.4.0
>         Environment: iOS
>            Reporter: Robert La Ferla
>            Assignee: Shazron Abdullah
>            Priority: Minor
>              Labels: addressbook, categories, contacts, groups, ios
>
> Contacts on iOS are organized by group.  There is the default group "All 
> Contacts" plus any custom groups that the user set up.  Contacts retrieved by 
> Apache Cordova / phonegap do not contain which group they are in. 
> CONTACT CATEGORIES PROPERTY
> I believe that iOS groups are analogous to phonegap contact categories and 
> thus should be mapped to them.  If not, another property should be created.
> From the Cordova docs:
> "categories: An array of all the contacts user defined categories. 
> (ContactField[])"
> IOS IMPLEMENTATION NOTES:
> In the iOS AddressBook API, the function ABAddressBookCopyArrayOfAllGroups() 
> gets the list of groups.
> https://developer.apple.com/library/ios/#documentation/ContactData/Conceptual/AddressBookProgrammingGuideforiPhone/Chapters/DirectInteraction.html#//apple_ref/doc/uid/TP40007744-CH6-SW1

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to