diff --git a/docs/api.md b/docs/api.md index 8b4530c..fa7f516 100644 --- a/docs/api.md +++ b/docs/api.md @@ -133,14 +133,15 @@ pickContact(options: PickContactOptions) => Promise #### NamePayload -| Prop | Type | -| ------------- | --------------------------- | -| **`display`** | string \| null | -| **`given`** | string \| null | -| **`middle`** | string \| null | -| **`family`** | string \| null | -| **`prefix`** | string \| null | -| **`suffix`** | string \| null | +| Prop | Type | +| --------------- | --------------------------- | +| **`display`** | string \| null | +| **`given`** | string \| null | +| **`middle`** | string \| null | +| **`family`** | string \| null | +| **`prefix`** | string \| null | +| **`suffix`** | string \| null | +| **`nick`** | string \| null | #### OrganizationPayload @@ -270,13 +271,14 @@ pickContact(options: PickContactOptions) => Promise #### NameInput -| Prop | Type | -| ------------ | --------------------------- | -| **`given`** | string \| null | -| **`middle`** | string \| null | -| **`family`** | string \| null | -| **`prefix`** | string \| null | -| **`suffix`** | string \| null | +| Prop | Type | +| -------------- | --------------------------- | +| **`given`** | string \| null | +| **`middle`** | string \| null | +| **`family`** | string \| null | +| **`prefix`** | string \| null | +| **`suffix`** | string \| null | +| **`nick`** | string \| null | #### OrganizationInput diff --git a/ios/Plugin/ContactPayload.swift b/ios/Plugin/ContactPayload.swift index 80d636e..36b154f 100644 --- a/ios/Plugin/ContactPayload.swift +++ b/ios/Plugin/ContactPayload.swift @@ -70,6 +70,7 @@ public class ContactPayload { self.name["family"] = contact.familyName self.name["prefix"] = contact.namePrefix self.name["suffix"] = contact.nameSuffix + self.name["nick"] = contact.nickname } // Organization diff --git a/ios/Plugin/Contacts.swift b/ios/Plugin/Contacts.swift index 501a3a2..5a0b478 100644 --- a/ios/Plugin/Contacts.swift +++ b/ios/Plugin/Contacts.swift @@ -120,6 +120,9 @@ public class Contacts: NSObject { if let nameSuffix = contactInput.nameSuffix { newContact.nameSuffix = nameSuffix } + if let nameNick = contactInput.nameNick { + newContact.nickname = nameNick + } // Organization if let organizationName = contactInput.organizationName { diff --git a/ios/Plugin/CreateContactInput.swift b/ios/Plugin/CreateContactInput.swift index 7c54f98..e9615b2 100644 --- a/ios/Plugin/CreateContactInput.swift +++ b/ios/Plugin/CreateContactInput.swift @@ -9,6 +9,7 @@ public class CreateContactInput { public var nameFamily: String? public var namePrefix: String? public var nameSuffix: String? + public var nameNick: String? // Organization public var organizationName: String? @@ -44,6 +45,7 @@ public class CreateContactInput { self.nameFamily = nameObject["family"] as? String self.namePrefix = nameObject["prefix"] as? String self.nameSuffix = nameObject["suffix"] as? String + self.nameNick = nameObject["nick"] as? String } // Organization diff --git a/ios/Plugin/GetContactsProjectionInput.swift b/ios/Plugin/GetContactsProjectionInput.swift index e86031c..5d3bfa3 100644 --- a/ios/Plugin/GetContactsProjectionInput.swift +++ b/ios/Plugin/GetContactsProjectionInput.swift @@ -70,6 +70,7 @@ public class GetContactsProjectionInput { projection.append(CNContactFamilyNameKey as CNKeyDescriptor) projection.append(CNContactNamePrefixKey as CNKeyDescriptor) projection.append(CNContactNameSuffixKey as CNKeyDescriptor) + projection.append(CNContactNicknameKey as CNKeyDescriptor) } // Organization diff --git a/src/definitions.ts b/src/definitions.ts index 5cd6333..f760d75 100644 --- a/src/definitions.ts +++ b/src/definitions.ts @@ -134,6 +134,7 @@ export interface NamePayload { family: string | null; prefix: string | null; suffix: string | null; + nick: string | null; } export interface OrganizationPayload { @@ -240,6 +241,7 @@ export interface NameInput { family?: string | null; prefix?: string | null; suffix?: string | null; + nick?: string | null; } export interface OrganizationInput {