1
現在、問題はあまり良くありません。私はすでに問題を作成しましたが、回答はありません。私は、カメラの中心位置を更新するために、あらゆる場所の変更が必要です。しかし、これは起こりません。リフレッシュは時間とともに定義できません。それは私の必要性のために非常にまれです。 AndroidとiOSは同じです。ログは1分ごとに呼び出されます。 また、ngZone
の外部にあるコンソールログを試しましたが、それは同じです。 これは私の構成コードは次のようになります。Ionic 3:BackgroundLocationの更新があまりにも珍しい
let config = {
desiredAccuracy: 0,
stationaryRadius: 1,
distanceFilter: 0,
debug: true,
interval: 2000,
pauseLocationUpdates: false,
activityType: "AutomotiveNavigation"
};
this.backgroundGeolocation.configure(config).subscribe((location) => {
// Run update inside of Angular's zone
this.zone.run(() => {
if(this.map) {
this.map.getMyLocation().then((userLocation: MyLocation) => {
console.log("INSIDE ZONE Google Maps Location \n LAT: " + userLocation.latLng.lat + "\nLNG: " + userLocation.latLng.lng);
this.userLocation = userLocation.latLng;
this.speed = userLocation.speed;
this.bearing = userLocation.bearing;
this.altitude = location.altitude;
this.cameraFollow();
this.notify(this.nearestReports[0]);
}).catch(error => {
alert("Background - NO GPS FOUND: " + error);
});
}
});
});
// Turn ON the background-geolocation system.
this.backgroundGeolocation.start();
しかし、このプラグインは、バックグラウンドの場所のために働いていないそうではありませんか? – TdoubleG
私は正直には分かりません。私は[アンドロイドがバックグラウンドロケーションサービスをどのように処理するか]を確認しました(https://developer.android.com/reference/android/location/LocationManager.html#requestLocationUpdates(long、%20float、%20andandroid.location.Criteria、%20android.app .PendingIntent)))ただし、Location Pluginが使用するプラグインは依存しています。Location Updateの経過時間は、Location Providerの実装と他のアプリケーションから要求された更新間隔によりますが、minTimeより小さくなることはありません'。したがって、実際にはバックグラウンドで最小化する方法はありません。 – maninak
私はこれがあなたの質問に答えたことを願っています。 – maninak