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.

[GitHub/Examples] sendRemoteNotificationWithData(token) is not showing up Notification

See original GitHub issue

With code examples is working incorrect.

"dependencies": {
   "react": "16.0.0-alpha.12",
   "react-native": "0.48.0",
   "react-native-fcm": "^10.0.3"
 },

I fix like this and worked! i add more custom_notification

sendRemoteNotificationWithData(token) {
    let body = {
      "to": token,
      "notification": {
        "title": "Simple FCM Client",
        "body": "This is a notification with NOTIFICATION and DATA (NOTIF).",
        "sound": "default"
      },
      "data": {
        "custom_notification": {
          "title": "Simple FCM Client",
          "body": "This is a notification with NOTIFICATION and DATA (NOTIF)..",
          "sound": "default",
          "priority": "high",
          "show_in_foreground": true
        },
        "property1": "value1",
        "property2": "value2",
        "property3": "value3"
      },
      "priority": "high"
    }

    firebaseClient.send(JSON.stringify(body), "notification-data");
 }

Anyone show me all {key:value} infomation in body }? BEcause i dont know why using Custom_notification is valid here!

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
nighttiger1990commented, Nov 22, 2017

@evollu its my fail. I just updated code. i mean this code in Example not working: Client got data but no notification. (remove key ‘notification’ then add key ‘custom_notification’ into ‘data’) its worked

    sendRemoteNotificationWithData(token){
        ....
    }
let body = {
      "to": token,
      "notification":{
    		"title": "Simple FCM Client",
    		"body": "This is a notification with NOTIFICATION and DATA (NOTIF).",
				"sound": "default"
    	},
    	"data":{
    		"hello": "there"
    	},
    	"priority": "high"
    }
0reactions
evollucommented, Nov 29, 2017

Can i close this?

Read more comments on GitHub >

github_iconTop Results From Across the Web

expo-notifications failing to get token · Issue #18570 - GitHub
Summary I am having issues with expo-notifications. ... getting token in expo go, but not working in production mode. getting error [Error: No...
Read more >
Not receiving push device token in… | Apple Developer Forums
Hi there, I'm seeing weird behavior when trying to register for push notifications in macOS development builds for any of my apps
Read more >
Notifications - Expo Documentation
The expo-notifications provides an API to fetch push notification tokens and to present, schedule, receive and respond to notifications.
Read more >
Best practices for FCM registration token management
Retrieve and store registration tokens; Detect invalid token responses from ... showing up as a dramatic (but not actually valid) drop in delivery...
Read more >
3095470 - [[Firstname]] [[Lastname]] tokens are not showing in ...
1. Login as the Onboardee · 2. The Welcome Message task will pop up · 3. Message will show the placeholder tokens and...
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