diff --git a/src/ios/CDVContact.swift b/src/ios/CDVContact.swift index 2d042e61..79e22ce6 100644 --- a/src/ios/CDVContact.swift +++ b/src/ios/CDVContact.swift @@ -999,6 +999,13 @@ let kW3ContactUrls = "urls" if value != nil { nc[kW3ContactPhoneNumbers] = value } + + // emails array + // NSLog(@"getting emails"); + value = extractMultiValue(kW3ContactEmails) + if value != nil { + nc[kW3ContactEmails] = value + } return nc } else { // if no returnFields specified, W3C says to return empty contact (but Cordova will at least return id) diff --git a/src/ios/CDVContacts.swift b/src/ios/CDVContacts.swift index 25e5eda2..79ea0569 100644 --- a/src/ios/CDVContacts.swift +++ b/src/ios/CDVContacts.swift @@ -50,7 +50,8 @@ class CDVNewContactsController: CNContactViewController { CNContactNamePrefixKey as CNKeyDescriptor, CNContactNameSuffixKey as CNKeyDescriptor, CNContactPhoneNumbersKey as CNKeyDescriptor, - CNContactTypeKey as CNKeyDescriptor] + CNContactTypeKey as CNKeyDescriptor, + CNContactEmailAddressesKey as CNKeyDescriptor] // overridden to clean up Contact statics override func onAppTerminate() {