question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Custom data on FirebaseAdmin.Messaging.Notification?

See original GitHub issue

Hello, I’m trying to send a notification with this sdk and I’m supposed to set "click_action":"FCM_PLUGIN_ACTIVITY" on the notification object so that our cordova app can handle click events. Is there any way to do this via the sdk?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
hiranya911commented, Sep 23, 2019

click_action is only available for AndroidNotification in the v1 API: https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages#androidnotification

0reactions
chong-shaocommented, Oct 15, 2019

Hi halomademeapc, the fields in Notification object all map to fields in all platforms (Android, iOS, and Webpush). But if I understand it correctly, clieck_action do not have a corresponding field in iOS https://developer.apple.com/library/archive/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/PayloadKeyReference.html#//apple_ref/doc/uid/TP40008194-CH17-SW1 therefore it makes less sense to have it in the Notification object.

I assume you have an Android app. Setting it in AndroidNotification should be the correct approach. If it does not have any effect on your Android app, could you double check if your app’s implementation in handling the notification’s click_action works as intended.

Read more comments on GitHub >

github_iconTop Results From Across the Web

About FCM messages | Firebase Cloud Messaging - Google
Notification messages contain a predefined set of user-visible keys. Data messages, by contrast, contain only your user-defined custom key-value pairs.
Read more >
Build app server send requests | Firebase Cloud Messaging
You can send messages with a notification payload made up of predefined fields, a data payload of your own user-defined fields, or a...
Read more >
Make a custom data for parameter on firebase to call ...
I want to create custom data in Firebase to call that data on my push notification. At least that data can call on...
Read more >
Sending Push Notifications by Using Firebase Cloud ...
You can add this kind of messages if you want to send some only data along with the notification. It contains custom key...
Read more >
Cloud Messaging
The remoteMessage property contains all of the information about the message sent to the device from FCM, including any custom data (via the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found