Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Background Notification in Firebase: Android Oreo

I tried to make notification in android 8. First there was a problem with defining notification channel. After that I got notification in android pre-Oreo and android Oreo just when application was running. I tried Job Scheduler and JobIntentService and also AsyncTask to make notification in android Oreo when application is not running but every time I got crash with below message.

java.lang.RuntimeException: Unable to start receiver com.google.firebase.iid.FirebaseInstanceIdReceiver: java.lang.IllegalStateException: Not allowed to start service Intent { act=com.google.firebase.MESSAGING_EVENT pkg=... (has extras) }: app is in background uid UidRecord{9078fd9 u0a148 RCVR idle procs:1 seq(0,0,0)}

What should I do for make notification in firebase background?

like image 479
Karo Avatar asked Apr 27 '26 14:04

Karo


1 Answers

Use JobIntentService instead IntentService.


See also:

  • this answer in FirebaseMessagingService Crashes on Android O due to background execution limits
like image 197
Abdulmoiz Esmail Avatar answered Apr 30 '26 03:04

Abdulmoiz Esmail



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!