Clone this repo and change to the SampleApp directory:
$ git clone https://github.com/foreseecode/verint-xm-cordova-sample
$ cd verint-xm-cordova-sample/SampleApp/
The instructions below will assume you've successsfully cloned the project and navigated to the SampleApp directory.
$ cordova plugin add https://github.com/foreseecode/verint-xm-cordova-plugin
$ cordova plugin add https://github.com/foreseecode/verint-xm-cordova-plugin#develop
Clone the repo dir and prepare for use
$ git clone https://github.com/foreseecode/verint-xm-cordova-plugin
$ cd verint-xm-cordova-plugin
$ npm install
Then return to your sample app and add the plugin using the path to the plugin repo you just checked out:
$ cordova plugin add <PATH_TO_REPO_DIR>/verint-xm-cordova-plugin --nofetch
-
Connect an Android device or start an emulator
-
Set up the required environment variables
You will need to authenticate with GitHub Packages to download our native Android library. To do so, you'll need a personal key which can be generated from your GitHub account by following the instructions. The token will need the
read:packagespermission.Once you have that key, you should set two environment variables on your machine:
GITHUB_USERNAMEfor your username, andGITHUB_PERSONAL_KEYfor your personal key. Those environment variables will be picked up by the plugin's/build.gradlefile.See Getting Started guide for more information.
-
Install the platform
$ cordova platform add android -
Prepare:
$ cordova prepare -
Build and run:
$ cordova run android
-
Install the platform
$ cordova platform add ios -
Prepare:
$ cordova prepare -
The above commands will in most cases run
pod installautomatically, but if not (check their output), then the command can be run manually:cd platforms/ios pod install --repo-update cd ../.. -
Select a development team (see Running on an iOS Device, below)
-
Build and run:
$ cordova run ios
In order to run on iOS, you'll need to select a valid development team, which you can set up using the build.json file in the root of the project.
- Open Keychain Manager
- Right click your development certificate and select Get info...
- Copy the value in Common name
- Paste it over the
codeSigningIdentityin yourbuild.json - Open your provisioning profile and copy the UUID
- Paste it over the
provisioningProfilein yourbuild.json - Add your development team ID into the
developmentTeamin yourbuild.json - Run
$ cordova run ios
Here are some commands that can be run from the Verint-XM Cordova Plugin:
cordova.plugins.verint.xm.start(null, this.onSuccess, this.onError);
cordova.plugins.verint.xm.start(configJSON, this.onSuccess, this.onError);
cordova.plugins.verint.xm.checkEligibility(this.onSuccess, this.onError);
cordova.plugins.verint.xm.showInvite("android_app_QA", this.onSuccess, this.onError);
cordova.plugins.verint.xm.resetState(this.onSuccess, this.onError);
Apache License, Version 2.0 https://www.apache.org/licenses/LICENSE-2.0
There is currently an issue with the iOS minimum SDK version, which will be fixed, according to Cordova support:
https://issues.apache.org/jira/browse/CB-13597
There is currently an issue with the Android minimum SDK version, which will be fixed, according to the official Cordova blog:
http://disq.us/p/1oqjjtg
If you see one of the following error messages:
Error: Unhandled error. ('[ios-sim] Could not boot simulator 6075A271-091D-4BC8-86AA-58479762FC21\n')
or
Error: Unhandled error. ('[ios-sim] An error was encountered processing the command (domain=FBSOpenApplicationServiceErrorDomain, code=1):\n' +
'Simulator device returned an error for the requested operation.\n' +
'The request was denied by service delegate (SBMainWorkspace) for reason: Unspecified ("null").\n' +
'Underlying error (domain=FBSOpenApplicationServiceErrorDomain, code=1):\n' +
'\tThe request to open "com.verint.xm.cordova.sample" failed.\n' +
'\tThe request was denied by service delegate (SBMainWorkspace) for reason: Unspecified ("null").\n')
It's possible that Cordova is defaulting to a broken simulator instance. You can work around this issue by specifying a specific simulator to use, e.g.
cordova run ios --target "iPhone-14-Pro-Max" --emulator
You can get a list of all the available simulators by running xcrun simctl list.
It's important to use the name from the Device Types list, which includes the hyphens.