Firebase push notification generated from console by default opens launcher activity on clicking when app is in background.Is there any way to customise the click events when app is in background since onMessageReceived is not called?I looked at other answers but still not able to implement tht..
Asked
Active
Viewed 147 times
0

Frank van Puffelen
- 565,676
- 79
- 828
- 807

Android Developer
- 9,157
- 18
- 82
- 139
-
Just override `onMessageReceived()` in your service extending `FireBaseMessagingService` – Gaurav Jun 14 '16 at 09:56
-
1@Gaurav onMessageReceived() is only called when app is in foreground – Android Developer Jun 14 '16 at 09:57
-
ya, right , check this https://firebase.google.com/docs/cloud-messaging/downstream#sample-receive Handle messages in a backgrounded app – Gaurav Jun 14 '16 at 10:06
-
@Gaurav already read tht..can we handle this without using custom server or curl commands? – Android Developer Jun 14 '16 at 10:10
-
check my answer and try – Gaurav Jun 14 '16 at 10:18
-
You currently cannot override the click behavior for the notification when the app is backgrounded. See http://stackoverflow.com/questions/37809885/firebase-push-notifications-update-db/37814092#37814092 (and those linked from there). – Frank van Puffelen Jun 14 '16 at 14:03