Capacitor installation instructions¶
Note
July 2022 - we have ceased to support Ionic/Cordova/Capacitor. This documentation remains for existing customers.
Requirements¶
This setup assumes you have already setup your App Key on the Dashboard
The Capacitor NPM is available here https://www.npmjs.com/package/capacitor-plugin-pointzi
Integration Steps¶
Step 1 - Install dependencies¶
Install dependencies for Contextual plugin.
1 2 3 4 5 6 |
|
Step 2 - Installation¶
Install Contextual in your Capacitor project. Run this command in a console.
1 |
|
Step 3 - Setup assets¶
You need copy asset files of plugin into your dist folder with following structure "/capacitor-plugin-pointzi/assets/". For example:
1 |
|
You can do that by edit your build configuration file. Assume that you are using angular, so you put this code into assets configuration section inside angular.json:
1 2 3 4 5 |
|
When you have done, it looks like:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
|
Step 4 - Contextual initialisation¶
Add this code into constructor of your root component. For example, assuming you use angular, your root component file is app.component.ts.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
|
Note
To get your APP_KEY
, go to dashboard.contextu.al, where you can see it's name at the top left of the screen.
USER_ID
is the name you want to give to your install-id. This name is up to you. For more info visit the Tagging documentation. When you call register
method, USER_ID is optional, you can set it later by sending user_id
tag, it is a string tag.
User Tagging¶
You can tag users/devices from your SDK in one line of code.
The SDK looks after the details for the device, you just supply the tag key and value:
- The tag name (key) is what you want to call it. In the example below "Plan-49" is how you will see this in the Contextual Dashboard.
- Contextual supports tags of: string, numeric and datetime. In the example below, the value for "Plan-49" is "Trial-Period".
String Tags¶
1 2 3 |
|
Numeric Tags¶
1 2 3 |
|
Datetime Tags¶
1 2 3 4 5 6 7 8 9 |
|
Increment Tag Value¶
1 2 |
|