1.0.0 • Published 5 years ago

nativescript-zendesk-chat-ui v1.0.0

Weekly downloads
3
License
Apache-2.0
Repository
github
Last release
5 years ago

NativeScript Zendesk Chat UI

Exposes Zendesk Chat SDK for iOS and Android.

Installation

Describe your plugin installation steps. Ideally it would be something like:

tns plugin add nativescript-zendesk-chat-ui

Usage

ZendeskChatUi.initialize(key); // your key here
ZendeskChatUi.startChat(); // start a chat

API

ZendeskChatUi

MethodDefaultDescription
startChat(chatConfig?: ChatConfig)nullStart a chat with a chat configuration.
initialize(accountKey: string)nullyour zendesk chat account key. required.
trackEvent(eventDescription: string)nulltrack event.
PropertyDefaultDescription
visitorInfo: VisitorInfonullset user's the email, name, phone number, note.
chatOverlayEnabled: booleantruehide the chat overlay. iOS only

VisitorInfo

export interface VisitorInfo {
  name?: string;
  email?: string;
  phoneNumber?: string;
  note?: string;
}

ChatConfig

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;
  };
}

PreChatDataRequirement

export enum PreChatDataRequirement {
  NotRequired = 0,
  Optional = 1,
  Required = 2,
  OptionalEditable = 3,
  RequiredEditable = 4
}

Customization

For customization, please refer to the iOS and Android documentation.

License

Apache License Version 2.0, January 2004