Introduction
In this post we will look into how we can ask the user to allow notifications in the android part in our react native app when the us...
For further actions, you may consider blocking this person and/or reporting abuse
Do I really need to add the mentioned push notifications library? I'm using firebase messaging and notifee library for push notification. Can you update the article how to fix the target SDK 33 issue with these?
Yes, you can utilize this for prompting notifications, and for other functionalities, you can incorporate FCM.
One issue with this now, when app is in background, upon clicking the notification, the app is supposed to open up from background to home page. But actually it does nothing at all, and the notification disappears. Happens only in android 13. Using @react-native-firebase/app and @react-native-firebase/messaging for notifications. Any leads with this ?
This also happens in Android 14. So I am using notifee with FCM combo to get it working for my apps.
Handy guide! it really helped me but only in the emulator, I don't understand why in the real device it never asks for permission, being exactly the same code. Any idea?
You have to check if the android version you are using is 13 and above. It wont ask if version is less than 12.
Thank you for explaining why it do not ask for permission. However, I am facing an issue where the notification appears in the emulator but not on a real device.
Yeah please check if the android version is 13 or above in your real device and let me know.
I was able to solve it based on what you told me, by not asking for permission the validation that arrived was a different one, instead of 'granted' it was 'never ask again'. My emulator was a different android version than my mobile.
Glad to know it worked!
thanks man there were 0 tutorial regarding this
Glad it helped you out.
How to use this component and where should I import
Thank you, this saved us a ton of headache!
Thanks dude
life saver dude! Right now updating react native from 0.65 to .70+ has been such a pain just for updating the android sdk api version. One thing I wanted to add is if you don't want to always make the changes when doing
npm install
oryarn install
is to usepatch-package
library to make a patch of the changes which will save those edits even if you clean your node_modules folder and reinstallI wanted to ask if there was a way to check if the app has permissions for notifications without asking the user? We had a logic that checked the permission using react native firebase library with
messaging().hasPermission()
but this now does not work.Thanks!