-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🔥v5.6.0: Push Notifications not working on RN60.6 #3188
Comments
Please don't pick and choose which parts of the files you post, we need the whole files. We also need to know what APIs you're trying against Android. |
// Edited to remove potentially sensitive info |
Try de-integrating your splash activity as a temporary test. Sometimes those cause problems (crazycodeboy/react-native-splash-screen#289 (comment)) You didn't post package.json so I'm not sure which splash screen you're using but the one I linked to has issues if not integrated carefully What does raw adb logcat tell you? |
// Edited to remove potentially sensitive info (it's just a package.json) |
well, usually I learn more or the same as I end up teaching/helping so it helps me too up to a point ;-). But this is very odd. Honestly just to make sure you aren't going crazy (I mean, you're doubting you're even sending a push notification correctly at this point...which is natural but also calls everything into question) I would make a throwaway app with just the minimum integration required for messaging and prove you can make it work. Then I would sort of hack-and-slash a "bisect" of functionality between the minimal "it works" throwaway and your full app. First attempt to integrate about half the things you've got in AndroidManifest and see if it still works then focus on each smaller half until you arrive. It is kind of brutal to do but also works. For a minimal starter you can begin with this (it'll be react-native 0.61.5 + react-native v5): https://github.com/mikehardy/rnfbdemo/blob/master/make-demo.sh |
I'm gonna sound like an absolute nufty, but it turned out that after AAAAAAAAALL of this (I created a new blank from scratch using the script above and basically rebuilt EVERYTHING, it turned out that I had had everything configured correctly (just as per the docs) from the start, and my actual issue was that I was sending the test push notification from the wrong bloody Firebase project! I've edited out the files I posted above just in case there's some sensitive info in there, but all it was was everything in the RNFirebase v5.x.x Docs, nothing fancy! On a nicer note, now I have an android / ios project that is completely fresh and doesn't have 3 year old code form React Native's infancy sticking around that no one here remembers how to use! Cheers for your help Mike! |
Issue
After a few full days of banging my head against a wall following Push notifications aren't working for me following the docs as well as Invertase's recommended Medium article, I cannot for the life of me get push notifications to work.
Project Files
I'm really there's something simply wrong with my setup that I've managed to overlook! I can get an FCM token in-app
android/build.gradle
android/app/build.gradle
androidManifest.xml
MainApplication.java
package.json
:Have you converted to AndroidX?
android/gradle.settings
jetifier=true
for Android compatibility?jetifier
for react-native compatibility?Final Notes
In JS, using
firebase.messaging().getToken();
, I'm able to successfully get an FCM token.I'm going into our project in Firebase and sending a test notification to this device (emulated Pixel 2)
The notification does not appear on my device.
So:
Prior to upgrading React Native (from 59) and RNFirebase, this worked fine. Not sure what I'm doing wrong here! Any tips?
The text was updated successfully, but these errors were encountered: