0.0.5 • Published 4 years ago

capacitor-plugin-pointzi v0.0.5

Weekly downloads
1
License
MIT
Repository
gitlab
Last release
4 years ago

capacitor-plugin-pointzi

A wrapper of Pointzi Web SDK and do operations for preview mode.

How to install:

Step 0: Dependencies

Install dependencies for Pointzi plugin.

npm i com.darktalker.cordova.screenshot
npm i cordova-plugin-app-version
npm i cordova-plugin-device
npm i cordova-plugin-device-name
npm i cordova-plugin-dialogs
npm i cordova-plugin-network-information

Step 1: Install plugin

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

npm i capacitor-plugin-pointzi

Step 2: Setup assets

You need copy asset files of plugin into your dist folder with following structure "/capacitor-plugin-pointzi/assets/". For example:

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:

{
  "glob": "**/*",
  "input": "node_modules/capacitor-plugin-pointzi/src/assets",
  "output": "./capacitor-plugin-pointzi/assets"
}

When you have done, it looks like:

{
  "projects": {
    "app": {
      "architect": {
        "build": {
          "options": {
            "assets": [
              {
                "glob": "**/*",
                "input": "node_modules/capacitor-plugin-pointzi/src/assets",
                "output": "./capacitor-plugin-pointzi/assets"
              }
            ]
          }
        }
      }
    }
  }
}

Step 3: Init Pointzi service

Add code into constructor of your root component. For example, assumed you use angular, your root component file is app.component.ts.

import { Plugins, StatusBarStyle } from '@capacitor/core';
import 'capacitor-plugin-pointzi';

const { Pointzi } = Plugins;

export class AppComponent {
  constructor(private platform: Platform) {
    this.initializeApp();
  }

  async initializeApp() {
    Pointzi.load().then(function () {
      Pointzi.register(APP_KEY, CUID).then(function () {
        // Send String Tag
        Pointzi.tag({
          key: 'first_name',
          string: 'My First Name',
        });
      });
    });
  }
}

Note: To get your APPKEY, go to dashboard.pointzi.com, it is name on the Top left. CUID is the name you want to give to your install-id. This name is up to you. For more info visit, Tagging documentation

API

load()

load() => any

Returns: any


register(...)

register(appKey: string, eventKey: string, cuid?: string | undefined) => any
ParamType
appKeystring
eventKeystring
cuidstring

Returns: any


isInstalled()

isInstalled() => boolean

Returns: boolean


update(...)

update(payload: any) => any
ParamType
payloadany

Returns: any


setClientVersion(...)

setClientVersion(version: any) => any
ParamType
versionany

Returns: any


newPage()

newPage() => void

showOnDemandCampaign(...)

showOnDemandCampaign(campaignid: string) => void
ParamType
campaignidstring

Interfaces

TagService

MethodSignature
string(key: string, value: string) => any
numeric(key: string, value: number) => any
datetime(key: string, value: any) => any
increment(key: string, length?: number | undefined) => any