Getting Started

Note: Currently cordova-plugin-gotenna only supports Android. iOS support will come in a later release.

Prerequisites

  • Cordova 8.0.0

  • Cordova Android 7.0.0

The minimum android sdk level supported by Cordova Plugin Gotenna is 18. Add the "android-minSdkVersion" preference to the config.xml file a the root of your cordova project:

config.xml
<widget id="tld.company.app" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
  <preference name="android-minSdkVersion" value="18" />
</widget>

Installation

Because this plugin is still a work in progress it is not currently published on the cordova registry. In the meantime it can be installed with

cordova plugin add https://github.com/dansteren/cordova-plugin-gotenna.git

Usage

The goTenna SDK is attached directly to window. and is accessible without any further work on your part. It is only available, however, after Cordova is available. This means you will need to wait for Cordova's deviceready event to fire before gotenna is available.

index.js
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
  // Plugins are now available.
  window.goTenna.setApplicationToken('your-token-here');
}

REMEMBER! You must initialize goTenna with your unique goTenna developer token before you do anything else.

A note about Typescript

Despite it being built in typescript, the plugin does not currently ship with typescript definitions. This is in part due to it's pre-stable status and changing API. In the future the plugin will ship as an ES6 module allowing you to import methods from the gotenna package directly. For now, you can use the following definition file, which is still a work in progress:

This definition file can be placed anywhere in your project, though I would recommend placing it right next to index.ts.

Last updated