Updated Branches: refs/heads/master ecd6d17ff -> 33d1ef23e
Updated iOS chooseContact to return full contact and id Previously was just returning the id, now returns id and full contact object in order to maintain backwards compatibility with previous versions. Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/commit/33d1ef23 Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/tree/33d1ef23 Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/diff/33d1ef23 Branch: refs/heads/master Commit: 33d1ef23eeabde0936351db8bda7fee27a85377d Parents: ecd6d17 Author: Becky Gibson <becka...@apache.org> Authored: Thu Aug 16 11:11:32 2012 -0400 Committer: Becky Gibson <becka...@apache.org> Committed: Thu Aug 16 11:33:50 2012 -0400 ---------------------------------------------------------------------- lib/ios/plugin/ios/contacts.js | 14 ++++++++++++-- 1 files changed, 12 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/33d1ef23/lib/ios/plugin/ios/contacts.js ---------------------------------------------------------------------- diff --git a/lib/ios/plugin/ios/contacts.js b/lib/ios/plugin/ios/contacts.js index 824418d..0a0d1b2 100644 --- a/lib/ios/plugin/ios/contacts.js +++ b/lib/ios/plugin/ios/contacts.js @@ -23,9 +23,19 @@ module.exports = { * allowsEditing: boolean AS STRING * "true" to allow editing the contact * "false" (default) display contact + * fields: array of fields to return in contact object (see ContactOptions.fields) + * + * @returns + * id of contact selected + * ContactObject + * if no fields provided contact contains just id information + * if fields provided contact object contains information for the specified fields * - * returns: the id of the selected contact as param to successCallback */ - exec(successCallback, null, "Contacts","chooseContact", [options]); + var win = function(result) { + var fullContact = require('cordova/plugin/contacts').create(result); + successCallback(fullContact.id, fullContact); + }; + exec(win, null, "Contacts","chooseContact", [options]); } }; \ No newline at end of file