- iOS Singular SDK v12.4.2
- Android Singular SDK 12.5.5
$ cordova plugin add singular_cordova_kids_sdk
NOTE: for Ionic installation see this section
Great installation, usage and setup guides can be viewed here.
Add the following lines to your code to be able to initialize tracking with your own Singular API Key and Secret Key:
document.addEventListener('deviceready', function() {
var singularConfig = new cordova.plugins.SingularCordovaSdk.SingularConfig("apiKey", "secretKey");
cordova.plugins.SingularCordovaSdk.init(singularConfig);
}, false);
A sample app can be found in here
Install the cordova plugin:
$ ionic cordova plugin add singular_cordova_kids_sdk
In your main ts file, declare a window variable:
declare var cordova;
Now you can use the Singular plugin directly from cordova:
import {Component} from '@angular/core';
import {Platform} from '@ionic/angular';
declare var cordova;
...
export class HomePage {
constructor(public platform: Platform) {
this.platform.ready().then(() => {
var singularConfig = new cordova.plugins.SingularCordovaSdk.SingularConfig("apiKey", "secretKey");
cordova.plugins.SingularCordovaSdk.init(singularConfig);
}); }}