Socket
Socket
Sign inDemoInstall

ionic-radar

Package Overview
Dependencies
0
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    ionic-radar

Ionic plugin for Radar, a location platform for mobile apps.


Version published
Weekly downloads
1
decreased by-50%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

Radar Ionic Plugin

Radar is a location platform for mobile apps. This Ionic plugin let's you use Radar features in your Ionic application.

npm version

Available Radar Functions

Installation


ionic cordova plugin add ionic-radar

Usage


Setting up Radar Keys

For Android, under src -> android -> com -> Radar in Radar.java, add your Radar Key in the initialize method

public void initialize(CordovaInterface cordova, CordovaWebView webView) {
    super.initialize(cordova, webView);
    Context context = this.cordova.getActivity().getApplicationContext();
    Radar.initialize(context, "your_radar_key");
    Log.d(TAG, "Initializing Radar Plugin");
  }

For iOS, under ios in RadarWrapper.swift, add your Radar Key in the pluginInitialize function

override func pluginInitialize() {
      Radar.initialize(publishableKey: "your_radar_key");
}

Declaring Cordova

On whichever page you want to use the Radar plugin, you can declare cordova just below your exports, as follows:

declare var cordova: any;

Start Tracking

When you want to begin tracking the user's location in the background, simply call the start tracking method:

cordova.plugins.RadarPlugin.startTracking(value => {
});

Stop Tracking

To stop background location tracking, run:

cordova.plugins.RadarPlugin.stopTracking(value => {
});

Set User ID

If you want to give users a customized user ID rather than the one generated by Radar, you can do it by running the following:

cordova.plugins.RadarPlugin.stopTracking(userID, value => {
});

Check Permission

Check if the app has location permission:

cordova.plugins.RadarPlugin.checkPermissions();

Get Permission

Ask the user for location permission:

cordova.plugins.RadarPlugin.checkPermissions();

Keywords

FAQs

Last updated on 06 Jul 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc