简体   繁体   中英

App doesn't open when click on FCM notification(Sent from FCM panel)

Hi I am using FCM for push notification in my app.

libraries:

implementation 'com.google.firebase:firebase-core:16.0.3'
implementation 'com.google.firebase:firebase-messaging:17.3.2'

When i am sending notification from FCM panel , it is not opening app on some devices (Oneplus 6t, 5t) in some cases.

It works when I am sending notification using postman (data payload)

you need to set pending intent to your notification i can see that your asking how to add pending intent to notification sent from fcm panel, you should handle notification in OnMessageRecived in FirebaseMessagingService as in the following link

https://github.com/firebase/quickstart-android/blob/4017aac2bdc591dc8b9702953702f09921a4e76d/messaging/app/src/main/java/com/google/firebase/quickstart/fcm/java/MyFirebaseMessagingService.java#L47-L90

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM