Exposes Zendesk Chat SDK for iOS and Android.
Describe your plugin installation steps. Ideally it would be something like:
tns plugin add nativescript-zendesk-chat-ui
ZendeskChatUi.initialize(key); // your key here
ZendeskChatUi.startChat(); // start a chat
Method | Default | Description |
---|---|---|
startChat(chatConfig?: ChatConfig) | null | Start a chat with a chat configuration. |
initialize(accountKey: string) | null | your zendesk chat account key. required. |
trackEvent(eventDescription: string) | null | track event. |
Property | Default | Description |
---|---|---|
visitorInfo: VisitorInfo | null | set user's the email, name, phone number, note. |
chatOverlayEnabled: boolean | true | hide the chat overlay. iOS only |
export interface VisitorInfo {
name?: string;
email?: string;
phoneNumber?: string;
note?: string;
}
export interface ChatConfig {
department?: string;
tags?: string[];
uploadAttachmentsEnabled?: boolean; // ios only
preChatDataRequirements?: { // required fields the user will have to fill
department: PreChatDataRequirement;
email: PreChatDataRequirement;
message: PreChatDataRequirement;
name: PreChatDataRequirement;
phone: PreChatDataRequirement;
};
}
export enum PreChatDataRequirement {
NotRequired = 0,
Optional = 1,
Required = 2,
OptionalEditable = 3,
RequiredEditable = 4
}
For customization, please refer to the iOS and Android documentation.
Apache License Version 2.0, January 2004