[New Feature] Background Geolocation Typescript API

The Background Geolocation SDK for both Cordova and React Native now provides its own comprehensive Typescript API.

Cordova

Up until now, in order to use the SDK with Ionic, you had to fetch a reference from the window object:

No more: assuming the plugin has been added to node_modules (which $ ionic cordova plugin add... already does), you can now simply import it:

React Native

From here on, the API for both React Native and Cordova are identical. They both share the same typescript definitions, so going forward from here, the only difference is where you import "it" from.

Interfaces

Import interfaces as needed. On event-callbacks, for example:

Documentation

All the SDK’s documentation has been migrated from the old markdown files into the definition.d.ts files themselves, making it possible to auto-generate them using Typedoc and published to transistorsoft.github.io:

Document-management is much simpler now and docs themselves more enjoyable to write with the easy linking throughout the API. Typedoc’s templating system is great and I’m importing my own custom template. The docs are sure to evolve from here on.

Code-assist

Now you have code-assist. For example, start typing "BackgroundGeolocation.get

Since the docs have been migrated into the SDK’s Typescriptdefinitions.d.ts, a snippet of the docs will appear on hovering members, such as distanceFilter:

Method / event signatures:

Creator of Background Geolocation SDK. Professional plugin developers — geolocation specialists. https://www.transistorsoft.com

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store