Skip to content

Cordova Integration

Requirements

This setup assumes you have already setup your App Key on the Dashboard

See requirements.

Integration Steps

Install Pointzi in your Cordova project. Run this command in a console.

cordova plugin add cordova-plugin-pointzi

Put initial code to your device ready or platform ready handler, example:

Cordova

$(document).on('deviceready', function deviceIsReady() {
    /*Other Code */
    window.pointzi.load().then(function () {
         window.pointzi.register(APP_KEY, EVENT_KEY, CUID).then(function () {
              // Send String Tag
              window.streethawk.tag({
                key: "first_name",
                string: "My First Name"
              });
         })
    })
    /*Other Code */
 });

Ionic 4

this.platform.ready().then(() => {
    /*Other Code */
    window.pointzi.load().then(function () {
        window.pointzi.register(APP_KEY, EVENT_KEY, CUID).then(function () {
            // Send String Tag
            window.streethawk.tag({
                key: "first_name",
                string: "My First Name"
            });
        })
    })
    /*Other Code */
});

Note

To get your EVENT_KEY, go to dashboard.pointzi.com, click on SETUP->API->EVENT_KEY. To get your APP_KEY, go to dashboard.pointzi.com, where you can see it's name at the top left of the screen.

CUID is the name you want to give to your install-id. This name is up to you. For more info visit the Tagging documentation.

Enable Youtube video

Add this to your config.xml

<!-- Add the whitelist plugin -->
<plugin name="cordova-plugin-whitelist" spec="~1.2.0" />
<!-- White list https access to Youtube -->
<allow-navigation href="https://*youtube.com/*"/>