Step-by-Step Guide: Implementing Push Notifications in React Native with Firebase (Android)

Поділитися
Вставка
  • Опубліковано 28 січ 2025

КОМЕНТАРІ • 33

  • @ebubealphonsus8127
    @ebubealphonsus8127 Рік тому +6

    Simple and straightforward. Awesome. Thank you.

  • @rulasloquillo
    @rulasloquillo Рік тому +4

    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.

  • @JaiSingh-s7v
    @JaiSingh-s7v 4 місяці тому +1

    Thanks, it works very well

  • @anshifyaseen3066
    @anshifyaseen3066 Рік тому +3

    Nice video buddyyyy

  • @unbekannt8926
    @unbekannt8926 9 місяців тому +1

    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

  • @virendralondhe2088
    @virendralondhe2088 7 місяців тому +1

    Currently we are able to send the notification via local but when unable to send it via Server. Kindly assist.

  • @KalaiVani-fw7ki
    @KalaiVani-fw7ki 5 місяців тому +1

    I have got the token, but notification is not getting received once after pushed from Firebase. Any help ?

    • @EugineBryanCadiz
      @EugineBryanCadiz 5 місяців тому +1

      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;
      }, []);

  • @Josue-Arreaga
    @Josue-Arreaga 8 місяців тому

    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

  • @RathnammaB-nv3nb
    @RathnammaB-nv3nb 7 місяців тому +4

    My app is closing when i send test message

  • @berkayuge1034
    @berkayuge1034 5 місяців тому

    No task registered for key ReactNativeFirebaseMessagingHeadlessTask . I got this error while ı been trying to send notification.

  • @the_ashhar
    @the_ashhar 2 місяці тому +1

    will it work on expo environment

  • @siddharthtrivedi8692
    @siddharthtrivedi8692 4 місяці тому

    My app has logo but notification icon is not coming its showing white icon like your emulator

  • @prasannaJ-rf2wg
    @prasannaJ-rf2wg 11 місяців тому +2

    token was not generated
    how to resolve this issue?

    • @MohammadFahad-g4i
      @MohammadFahad-g4i 10 місяців тому

      What error are you facing?

    • @HeroDevCH
      @HeroDevCH  9 місяців тому +1

      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.

  • @AshutoshBaitharu
    @AshutoshBaitharu Місяць тому

    How to show Notification Banner, no tutorial seems to cover that!

  • @vignaanjunior382
    @vignaanjunior382 Рік тому +1

    The push notifications are not working for me

    • @vignaanjunior382
      @vignaanjunior382 Рік тому

      the token is getting generated , and I also gave push notification permissions

    • @HeroDevCH
      @HeroDevCH  Рік тому

      Have you closed the App
      You should close it to receive notifications

  • @muhammadyasir5906
    @muhammadyasir5906 Рік тому +2

    👍

  • @harshdeep7015
    @harshdeep7015 Рік тому +1

    How you are receiving notification without adding listener on Android?😂😂

    • @HeroDevCH
      @HeroDevCH  Рік тому +2

      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.

    • @harshdeep7015
      @harshdeep7015 Рік тому +5

      @@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

    • @nilak
      @nilak Рік тому

      @@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

    • @mayurbhat6564
      @mayurbhat6564 Рік тому

      Same here, i too didnt get notification following the same approach as @HeroDevCH@@harshdeep7015

    • @abdulhannan9981
      @abdulhannan9981 Рік тому

      @@harshdeep7015 Bro could you please tell me how to add listeners?

  • @roy.galaxy
    @roy.galaxy 5 місяців тому

    App stucks on splash screen after installing @react-native-firebase/mesaaging