Skip to content

Latest commit

 

History

History
55 lines (43 loc) · 1.25 KB

README.md

File metadata and controls

55 lines (43 loc) · 1.25 KB

react-native-zendesk

React Native bridge to Zendesk Support SDK v2 on iOS and Android.

Installation

  1. Add the package via yarn or npm
yarn add react-native-zendesk
npm install --save react-native-zendesk
  1. Link the modules to your native projects
react-native link react-native-zendesk
  1. For your iOS app, add Zendesk SDK 2 via Pod, add this to your pod pod 'ZendeskSDK', then pod install

  2. For your iOS app, add a Run Script build phase to your app target to strip the extra architectures from the Zendesk frameworks, with the following script:

bash "${BUILT_PRODUCTS_DIR}/${FRAMEWORKS_FOLDER_PATH}/ZendeskCoreSDK.framework/strip-frameworks.sh"

Getting Started

Initializing the Support SDK (Required)

const config = {
  zendeskUrl: ZENDESK_URL,
  appId: ZENDESK_APP_ID,
  clientId: ZENDESK_CLIENT_ID,
};

Zendesk.initialize(config);

Setting an identity (Required)

Setting an anonymous identity

Zendesk.identifyAnon();
Zendesk.identifyAnon(USER_NAME, USER_EMAIL);

Setting a unique identity

Zendesk.identifyJWT(USER_TOKEN);

Adding Help Center

// possible options to pass to the help center
interface Options {
  hideContactSupport?: boolean
}

Zendesk.showHelpCenter(OPTIONS);