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).
Cordovaの問題で困っていますか?
本格的なプロジェクトを構築している場合、トラブルシューティングに時間を費やす余裕はありません。Ionicのエキスパートが、保守、サポート、統合に関する公式サポートを提供しています。
インストール
Ionic Native Enterprise はIonic Teamが完全にサポートしメンテナンスしているプラグインを利用できます。 詳しくみる か、エンタープライズプラグインに興味があれば 連絡ください
サポートしているプラットフォーム
- Android
利用方法
React
Angular
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 => {});*

