Skip to content
This repository has been archived by the owner on Mar 29, 2023. It is now read-only.

Return email addresses on iOS #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/ios/CDVContact.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion src/ios/CDVContacts.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down