cordova-fabric-zendesk
Cordova plugin for Fabric Zendesk Integration
PLEASE NOTE THIS IS A BETA RELEASE AND ONLY CURRENTLY SUPPORTS ANDROID
This plugin defines a global zendesk
object, which allows you to launch various Zendesk related views as exposed by the Zendesk SDK.
Although the object is in the global scope, it is not available until after the deviceready
event.
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
console.log(window.zendesk);
}
Installation
This plugin requires quite a few variables to work properly. Don't blame me, blame ZenDesk ;}
cordova plugin add https://github.com/k1dbl4ck/cordova-fabric-zendesk \
--variable FABRIC_API_KEY=<your fabric.io API key> \
--variable CHAT_API_KEY=<your zendesk chat API key> \
--variable ZENDESK_DOMAIN=<your zendesk domain - e.g. https://mydomain.zendesk.com>
--variable ZENDESK_APP_ID=<your zendesk app id> \
--variable ZENDESK_CLIENT_ID=<your zendesk client id>
Functions
- window.zendesk.init(username, successCallback, errorCallback)
- window.zendesk.tickets()
- window.zendesk.help()
- window.zendesk.chat()
window.zendesk.init(username, successCallback, errorCallback)
Only needs to be called once. This initializes the SDK (and on a lower level allocates memory for it) with a username to use for other interactions.
window.zendesk.tickets()
Opens the ticket interface.
window.zendesk.help()
Opens the help interface.
window.zendesk.chat()
Opens the chat interface.
Supported Platforms
Android Quirks
You may need to add
dexOptions {
jumboMode = true
}
To the android section of your build.gradle (depending on how large your app is)