I have an ionic app which receives Firebase Cloud Messaging Notifications using phonegap-plugin-push plugin. This application has a calling notification dialog with “Accept” and “Reject” button. I am able to show this calling notification dialog when FCM notification is received. This works perfectly even my application is closed and not running when my phone is unlocked.
But i am not able to show calling notification dialog when the phone is locked. When FCM notification is received and phone is unlocked, I want to see the calling notification dialog. Can any one please help on this?
Here is my code in platform.ready()
const options: PushOptions = {
android: {},
ios: {
alert: 'true',
badge: true,
sound: 'false'
},
windows: {},
browser: {
pushServiceURL: 'http://push.api.phonegap.com/v1/push'
}
}
const pushObject: PushObject = this.push.init(options);
pushObject.on('notification').subscribe((notification: any) => {
const options: AppLauncherOptions = {
}
options.packageName = 'com.myproj.ionic4fcm';
this.appLauncher.launch(options).then(data=>{
this.router.navigate(['calling-dialog']);
});
}