synapsestudios / react-native-zendesk-support

DEPRECATED
MIT License
23 stars 26 forks source link

Issue #31: Create tickets in the background without zendesk's UI #32

Closed nabylb closed 5 years ago

nabylb commented 5 years ago

Summary

The Zendesk SDK has a API providers that can create and query tickets in the background without invoking the UI. This is a React Native implementation of the createrequest method that calls a request service to create a request on behalf of the end user.

Changelog

[Android] [NEW] - Send ticket in the background [iOS] [NEW] - Send ticket in the background

Test Plan

import ZendeskSupport from '@synapsestudios/react-native-zendesk-support'
...

// Initialize Zendesk
const config = {
  appId: ZENDESK_APP_ID,
  zendeskUrl: ZENDESK_URL,
  clientId: ZENDESK_CLIENT_ID,
}

ZendeskSupport.initialize(config);

// Define an identity
const identity = {
  customerEmail: "me@email.com",
  customerName: "Kaiser Soze",
}

ZendeskSupport.setupIdentity(identity)

// Send ticket in the background
// response is an object:
// {
//   request: {
//    id: // ticket id from the Zendesk database
//    email
//    subject
//    description
//  }
// }
const response = await ZendeskSupport.createRequest("Well, I believe in God and the only thing that scares me is Kaiser Soze.");