我有一个通过Firebase连接的超级应用程序。当驱动程序自动进入该应用程序时,该应用程序处于联机状态,但是当您按下该按钮使该应用程序脱机时,实时数据库中的数据将被删除,然后再次重新生成。我该如何解决这个问题?
firebase中的文件夹被标识为/ Drivers / ID。
NowWaitingForID() {
let location_locationTracker_loop = interval(1000).subscribe(() => {
// this.StartTracker(false);
this.StartTracker(false);
if (this.locationTracker.hasShown) {
location_locationTracker_loop.unsubscribe()
if (this.doneK) {
this.doneK = false
this.pop.presentToast('Now Online')
console.log(this.locationTracker.lng);
this.CheckForPreviousData();
this.showGps = false;
this.locationTracker.mapLoadComplete = true;
this.toggleStatus = true;
this.pop.loggedOff = false;
this.hasNotFoundMap = false;
this.StartTracker(true);
// this.pop.onRequest = true;
// alert('Very Weak')
if (this.platform.is('cordova')) {
// this.WaitForNotificationID();
this.StartListeningForChanges(this.notify_ID);
} else {
this.notification_Id = "3456787654567898765434567"
this.StartListeningForChanges(this.notify_ID);
console.log('waiting.....')
}
this.appReady = true;
console.log("connected")
if (!this.isBlocked) {
this.OneSignal.UpdateInfo(this.locationTracker.lat, this.locationTracker.lng, this.cartype);
this.myGcode.Reverse_Geocode(this.locationTracker.lat, this.locationTracker.lng, this.locationTracker.map1, false)
}
}
}
})
}