5 Possible Reasons Your Notifications Are Not Working In React Native
react-native-firebase-notifications && react-native-push-notifications
Library configuration
Whether you use react-native-firebase or react-native-push-notifications, there’s a bit of prior configuration you need to do for each native platform and, as you might expect, things will flat out not work for you if they are not done properly.
The configurations are pretty straight forward for either platform so you can just check them out here for firebase and here for react-native-push-notification. If you have any issues with that feel free to leave a comment below.
Firebase console vs Project configuration mismatch
If you are managing multiple firebase projects, be sure to use the proper console to test the proper project. I for one, found myself pushing test notifications from one project’s console to a different project’s client and had a real head scratcher for a good while. Simply make sure your google-services.json file matches your firebase console or backend server configuration.
Haven’t created a channel (client)
Android, at least, needs this to properly handle different types of notifications with different sounds and behaviors. For instance, channels are the reason you can disable notifications for “Tweets from people you know” without disabling notifications for “Direct messages” with Twitter for Android.
React-native-push-notifications library creates a default channel to handle these notifications but will likely not suit your use case. So if you find your background notifications not popping up or using that special sound you have, you might want to create some channels of your own.
Haven’t specified channel for push (server)
Once you have created your custom channels, the next step is to make sure to push your notifications to these channels from your server or console just like you would address a letter to a recipient’s mailbox.
From a node server, that might look something like this:
Extensive documentation for either of these notification libraries are already available on official repos and sites as well as articles like this but if you would like me to make an article on how I managed to get things working with either one library, let me know in the comments and I’ll see to that as soon as possible but otherwise you should be good to go from this point on :)