Repository: cordova-plugin-contacts Updated Branches: refs/heads/master 617fb764b -> a4599c250
CB-3950 Adds support for custom labels Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-contacts/repo Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-contacts/commit/a4599c25 Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-contacts/tree/a4599c25 Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-contacts/diff/a4599c25 Branch: refs/heads/master Commit: a4599c250c459c190542231047e27e7cbfe0bbcb Parents: 617fb76 Author: Vladimir Kotikov <[email protected]> Authored: Thu Nov 26 16:40:28 2015 +0300 Committer: Vladimir Kotikov <[email protected]> Committed: Fri Nov 27 13:11:27 2015 +0300 ---------------------------------------------------------------------- src/ios/CDVContact.m | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-plugin-contacts/blob/a4599c25/src/ios/CDVContact.m ---------------------------------------------------------------------- diff --git a/src/ios/CDVContact.m b/src/ios/CDVContact.m index 8a91ca6..0149a92 100644 --- a/src/ios/CDVContact.m +++ b/src/ios/CDVContact.m @@ -750,7 +750,9 @@ static NSDictionary* org_apache_cordova_contacts_defaultFields = nil; } else if ([label caseInsensitiveCompare:kW3ContactUrlProfile] == NSOrderedSame) { type = kABPersonHomePageLabel; } else { - type = kABOtherLabel; + // CB-3950 If label is not one of kW3*Label constants, threat it as custom label, + // otherwise fetching contact and then saving it will break this label in address book. + type = (__bridge CFStringRef)(label); } return type; @@ -787,7 +789,9 @@ static NSDictionary* org_apache_cordova_contacts_defaultFields = nil; } else if ([label isEqualToString:(NSString*)kABPersonHomePageLabel]) { type = kW3ContactUrlProfile; } else { - type = kW3ContactOtherLabel; + // CB-3950 If label is not one of kW3*Label constants, threat it as custom label, + // otherwise fetching contact and then saving it will break this label in address book. + type = label; } } return type; --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
