Cant See Action Buttons On Notification When App Is In Background
Solution 1:
In FCM there are three type of messages you can send
1. Notification message
FCM automatically displays the message to end-user devices on behalf of the client app. Notification messages have a predefined set of user-visible keys and an optional data payload of custom key-value pairs.
Use notification messages when you want FCM to handle displaying a notification on your client app's behalf.
2.Data message
Client app is responsible for processing data messages. Data messages have only custom key-value pairs.
Use data messages when you want to process the messages on your client app.
3. Both Notification and Data
Messages with both notification and data payload, both background and foreground. In this case, the notification is delivered to the device’s system tray, and the data payload is delivered in the extras of the intent of your launcher Activity.
So if you want to handle message on client side better you go with Data Message
For send Data Message
For Data Message you have to call post service using following URL
https://fcm.googleapis.com/fcm/send
Headers
Authorization:key=yourserverkey
Content-Type: application/json
Payload
{"data":"extra data to be send","to":"devicetoken"}Note: replace "to" with "registration_ids" : ["1","2","3","4","5","6"] for multiple devices
In Application onMessageReceived you can get data message using remoteMessage.getData()
For detail already mentioned this https://firebase.google.com/docs/cloud-messaging/concept-options
Here you also check to send notification to Topics using data message https://firebase.google.com/docs/cloud-messaging/android/topic-messaging

Post a Comment for "Cant See Action Buttons On Notification When App Is In Background"