Hi, what exactly steps to follow to be able to send notifications on iOS? cheers and great video. There really aren't many videos that explain this quick process.
Thank you for sharing your knowledge with us. Is it possible to make a Video about how to send push notifications to specific users with userID + firestore ? Thanks in advance
try closing the app, run it within the background and send again a notification. Because in the code he showed, there is no handler for the background message. if you want to know if notifications really get into the app with the app opened add a foreground message handler and modify the useEffect useEffect(() => { requestUserPermission(); getToken(); // Handle foreground messages const unsubscribe = messaging().onMessage(async remoteMessage => { console.log('A new FCM message arrived!', remoteMessage); const { title, body } = remoteMessage.notification || {}; Alert.alert( title || 'New Notification', body || 'You have received a new notification.' ); }); return unsubscribe; }, []);
Question is IOs the same? I look all over but I dont see anyone doing notifications for IO's I was looking into the documentation but I dont think there is much difference. Is there a reason why you didnt cover IOs? Thanks again for all your work
You have to see the integration video first then If your Firebase Cloud Messaging (FCM) token is not being generated, there could be a few reasons for this. Here are some steps you can take to troubleshoot and resolve the issue: Check Firebase Setup: Ensure that your Firebase project is set up correctly. Double-check that you have added your google-services.json file to your Android project or GoogleService-Info.plist file to your iOS project. Check Firebase Initialization: Make sure that Firebase is initialized properly in your app. This usually involves adding initialization code in your app's entry point (e.g., onCreate() method of your Application class for Android). Check Device Connectivity: Ensure that the device on which you are testing has an active internet connection. Token generation requires network connectivity. Check for Errors: Look for any error messages in the logs or console output of your app. Firebase might provide error messages that can help diagnose the issue. Handle Permissions: Make sure that your app has the necessary permissions to use FCM. For example, on Android, you need to request the INTERNET permission in your app's manifest file. Check Device Token Refresh: Firebase tokens can be refreshed periodically. Make sure you handle token refresh events correctly in your app and update your server with the new token when it changes. Check for Library Updates: Ensure that you are using the latest version of the Firebase SDK and that your app's dependencies are up to date. Test on Different Devices: If possible, try testing on different devices to see if the issue is specific to one device or configuration. Check Firebase Console: Sometimes, Firebase Console can provide insights into issues with token generation or configuration. Check the Firebase Console for any relevant information or error messages. Consult Firebase Documentation: If you're still unable to resolve the issue, consult the Firebase documentation or community forums for further assistance. There might be specific troubleshooting steps or common issues related to token generation.
If you are only interested in handling push notifications when your React Native app is in the background, you generally don't need to explicitly add a listener for foreground notifications. In the background, notifications are typically handled by the system, We use a background handler provided by the @react-native-firebase/messaging library. adding a listener is typically required to handle incoming push notifications in a React Native application. When your app is in the foreground Here in this channel I try to make things as simple as I can because it's for beginners.
@@HeroDevCH but as shown in this video I was not receiving the notification also enabled app's notification permission, after adding listener I got the notification
@@harshdeep7015 Excuse me, can you explain this to me about the listener? I followed the video, but at the time of testing my cell phone did not receive anything, when I closed the application only the message "No task registered for key ReactNativeFirebaseMessagingHeadlessTask" appears and well, in the foreground nothing happens
Simple and straightforward. Awesome. Thank you.
Thank you 😊
Hi, what exactly steps to follow to be able to send notifications on iOS? cheers and great video.
There really aren't many videos that explain this quick process.
I am going to create a video for that later 👌
same here
Thanks, it works very well
Nice video buddyyyy
Thank you
Thank you for sharing your knowledge with us. Is it possible to make a Video about how to send push notifications to specific users with userID + firestore ? Thanks in advance
Currently we are able to send the notification via local but when unable to send it via Server. Kindly assist.
I have got the token, but notification is not getting received once after pushed from Firebase. Any help ?
try closing the app, run it within the background and send again a notification. Because in the code he showed, there is no handler for the background message. if you want to know if notifications really get into the app with the app opened add a foreground message handler and modify the useEffect
useEffect(() => {
requestUserPermission();
getToken();
// Handle foreground messages
const unsubscribe = messaging().onMessage(async remoteMessage => {
console.log('A new FCM message arrived!', remoteMessage);
const { title, body } = remoteMessage.notification || {};
Alert.alert(
title || 'New Notification',
body || 'You have received a new notification.'
);
});
return unsubscribe;
}, []);
Question is IOs the same? I look all over but I dont see anyone doing notifications for IO's I was looking into the documentation but I dont think there is much difference. Is there a reason why you didnt cover IOs? Thanks again for all your work
My app is closing when i send test message
No task registered for key ReactNativeFirebaseMessagingHeadlessTask . I got this error while ı been trying to send notification.
will it work on expo environment
Unfortunately no
My app has logo but notification icon is not coming its showing white icon like your emulator
token was not generated
how to resolve this issue?
What error are you facing?
You have to see the integration video first
then
If your Firebase Cloud Messaging (FCM) token is not being generated, there could be a few reasons for this. Here are some steps you can take to troubleshoot and resolve the issue:
Check Firebase Setup: Ensure that your Firebase project is set up correctly. Double-check that you have added your google-services.json file to your Android project or GoogleService-Info.plist file to your iOS project.
Check Firebase Initialization: Make sure that Firebase is initialized properly in your app. This usually involves adding initialization code in your app's entry point (e.g., onCreate() method of your Application class for Android).
Check Device Connectivity: Ensure that the device on which you are testing has an active internet connection. Token generation requires network connectivity.
Check for Errors: Look for any error messages in the logs or console output of your app. Firebase might provide error messages that can help diagnose the issue.
Handle Permissions: Make sure that your app has the necessary permissions to use FCM. For example, on Android, you need to request the INTERNET permission in your app's manifest file.
Check Device Token Refresh: Firebase tokens can be refreshed periodically. Make sure you handle token refresh events correctly in your app and update your server with the new token when it changes.
Check for Library Updates: Ensure that you are using the latest version of the Firebase SDK and that your app's dependencies are up to date.
Test on Different Devices: If possible, try testing on different devices to see if the issue is specific to one device or configuration.
Check Firebase Console: Sometimes, Firebase Console can provide insights into issues with token generation or configuration. Check the Firebase Console for any relevant information or error messages.
Consult Firebase Documentation: If you're still unable to resolve the issue, consult the Firebase documentation or community forums for further assistance. There might be specific troubleshooting steps or common issues related to token generation.
How to show Notification Banner, no tutorial seems to cover that!
The push notifications are not working for me
the token is getting generated , and I also gave push notification permissions
Have you closed the App
You should close it to receive notifications
👍
How you are receiving notification without adding listener on Android?😂😂
If you are only interested in handling push notifications when your React Native app is in the background, you generally don't need to explicitly add a listener for foreground notifications. In the background, notifications are typically handled by the system, We use a background handler provided by the @react-native-firebase/messaging library.
adding a listener is typically required to handle incoming push notifications in a React Native application. When your app is in the foreground
Here in this channel I try to make things as simple as I can because it's for beginners.
@@HeroDevCH but as shown in this video I was not receiving the notification also enabled app's notification permission, after adding listener I got the notification
@@harshdeep7015 Excuse me, can you explain this to me about the listener? I followed the video, but at the time of testing my cell phone did not receive anything, when I closed the application only the message "No task registered for key ReactNativeFirebaseMessagingHeadlessTask" appears and well, in the foreground nothing happens
Same here, i too didnt get notification following the same approach as @HeroDevCH@@harshdeep7015
@@harshdeep7015 Bro could you please tell me how to add listeners?
App stucks on splash screen after installing @react-native-firebase/mesaaging