this.backgroundMode.enable();
this.backgroundMode.on('activate').subscribe(()=>{
this.backgroundMode.disableBatteryOptimizations();
this.backgroundMode.disableWebViewOptimizations();
this.backgroundMode.moveToBackground();
setInterval(()=>{
this.nativeAudio.preloadSimple('uniqueId1', 'assets/audio/custom_sound2.mp3');
this.dashboardService.getTodayOrders().then((data:any)=>{
if (data.result == "success") {
if (data.data.find( o => o.orderStatus == "1") != undefined) {
this.localNotifications.schedule( {
id: 1,
text: 'New Order is Arrival',
sound: 'file://audio/custom_sound2.mp3',
icon: 'https://image.flaticon.com/icons/svg/1205/1205747.svg',
});
this.nativeAudio.play('uniqueId1');
this.backgroundMode.enable();
}
}
},error=>{
console.log(error);
this.backgroundMode.enable();
});
this.backgroundMode.enable();
},120000);
},error=>{});