1

I actually want to show a screen or custom notification with sound which allow user to accept or decline a call just like whatsapp/skype.

I used firebase messaging to send notification to the particular user which trigger the method define in backgroundNotificationHandler. When the app is minimized or not even on the background the method only able to show me the toast message, But when I try to open a dialog or foreground service it giving me error. The error seems like it not getting the context.

FirebaseMessaging.onBackgroundMessage(backgroundNotificationHandler);

Code of BackgroundNotificationHandler Function

The same code working when the app is open to the user

Error On starting Foreground services

Sid
  • 165
  • 1
  • 1
  • 8

0 Answers0