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.

IOS Problem with data only message

See original GitHub issue

Thanks @evollu for this library. I have been struggling with getting push to work with FCM and ios for a while. I followed your instructions and when I was done, I could send messages from Firebase Console and I would receive them in the app. Here is my problem though, when I send the following using the FCM api, it works { "to": "token-here", "priority": "high", "notification": { "title": "You have a new message", "text": "The new message here" }, "data": { "customId": "<my custom id>", "badge": 0, "alert": "New data is available" } } but when I remove the notifications property, like this { "to": "token-here", "priority": "high", "data": { "customId": "<my custom id>", "badge": 0, "sound": "cheering.caf", "alert": "New data is available" } } the app does not display anything. Even the breakpoints in FCM.on(FCMEvent.Notification, async (notif) => are not being hit. What could I be doing wrong?

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
n8stowell82commented, Jun 14, 2018

so I am going to leave this here for any future people having the same issue.

TL;DR make sure you are using the latest Firebase Admin API for your project

I am using the Firebase admin api to send notifications from my server to the devices. data only messages were working then one day just stopped. I was researching this last night and saw the suggestion to set breakpoints in the AppDelegate.m file. Turns out notifications where never making it to my app at all unless I had the notification object included. When digging further into the firebase admin documentation I realized that I was using the legacy api (sendToDevice() vs send()) when I switched to the newer method I started seeing errors in my console that the Firebase cloud messaging api had not been enabled for this project. Luckily the error gave me a link to go to so that I could enable it. Once I followed that link (to another completely different area of google console 🙄 ) I was greeted with a great big “enable api” button. Now data only messages are working like a charm 😄

0reactions
pacekodingcommented, Mar 8, 2018

@Ikiugu i spent a whole day to fix this issue, then all works when i changed the dependencies "react-native-fcm": "^9.7.2" to "react-native-fcm": "6.2.3" i hope it helps you

Read more comments on GitHub >

github_iconTop Results From Across the Web

If you see No Service, Searching, or SOS on your iPhone or iPad
Turn cellular data off and then back on again. Go to Settings, then tap Cellular or Mobile Data. If you're using an iPad,...
Read more >
iPhone Cellular Data Not Working? Here's The Real Fix!
An Apple expert uses a step-by-step troubleshooting guide to show how to fix the problem when iPhone Cellular Data is not working!
Read more >
How To Fix Cellular Data Not Working On iPhone - Setapp
The article outlines key solutions for the situation when cellular data is not working on your iPhone or iPad.
Read more >
How to Fix Cellular Data Not Working on iPhone and iPad
Go to “Settings -> Cellular/Mobile Data -> Wi-Fi Calling,” and tap the toggle so that it's in the “Off” position. Iphone Wifi Calling...
Read more >
iPhone Cellular Data Not Working? 10 Fixes - MakeUseOf
The only message you see is “Your iPhone is not connected to the ... look at these easy ways to fix your iPhone's...
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