Search docs/

HyperTrack

HyperTrack cordova plugin wrapper for Ionic Native. Location-based services provider. Make sure to include your publishable key at config.xml (see HyperTrack Cordova Setup).

https://github.com/hypertrack/hypertrack-cordova

Cordovaの問題で困っていますか?

本格的なプロジェクトを構築している場合、トラブルシューティングに時間を費やす余裕はありません。Ionicのエキスパートが、保守、サポート、統合に関する公式サポートを提供しています。

今日連絡ください!

インストール

ionic cordova plugin add cordova-plugin-hypertracknpm install @ionic-native/hyper-track
Ionic EEでは、Ionic Teamが完全にサポートしメンテナンスしているプラグインを利用できます。 詳しくみる連絡ください。
ionic enterprise register --key=YOURPRODUCTKEYnpm install @ionic-enterprise/hyper-track

サポートしているプラットフォーム

  • Android

利用方法

import { HyperTrack } from '@ionic-native/hyper-track/ngx';

constructor(private hyperTrack: HyperTrack) { }

// Check if app has location permissions enabled
this.hyperTrack.checkLocationPermission().then(response => {
  // response (String) can be "true" or "false"
  if (response != "true") {
    // Ask for permissions
    this.hyperTrack.requestPermissions().then(response => {}, error => {});
  }
}, error => {});

// Check if app has location services enabled
this.hyperTrack.checkLocationServices().then(response => {
  // response (String) can be "true" or "false"
  if (response != "true") {
    // Request services to be enabled
    this.hyperTrack.requestLocationServices().then(response => {}, error => {});
  }
}, error => {});

// First set the current user. This can be done via getOrCreateUser() or setUserId()
this.hyperTrack.setUserId("xxx").then(user => {
  // user (String) is a String representation of a User's JSON

  this.hyperTrack.startTracking().then(userId => {}, trackingError => {});

  this.hyperTrack.createAndAssignAction('visit', 'lookupId','address', 20.12, -100.3).then(action => {
    // Handle action. It's a String representation of the Action's JSON. For example:
    // '{"eta":"Jul 17, 2017 12:50:03 PM","assigned_at":"Jul 17, 2017 12:34:38 PM",,"distance":"0.0",...}'
  }, error => {});

  // You can complete an action with completeAction() or completeActionWithLookupId()
  this.hyperTrack.completeAction('action-id').then(response => {
    // Handle response (String). Should be "OK".
  }, error => {});

  this.hyperTrack.getCurrentLocation().then(location => {
    // Handle location. It's a String representation of a Location's JSON.For example:
    // '{"mAccuracy":22.601,,"mLatitude":23.123456, "mLongitude":-100.1234567, ...}'
  }, error => {});

  this.hyperTrack.stopTracking().then(success => {
    // Handle success (String). Should be "OK".
  }, error => {});

}, error => {});*