Push Notification In React Native Using Firebase - Android & IOS Tutorial 2023

Поделиться
HTML-код
  • Опубликовано: 4 окт 2024
  • Hey this is Sheikh Adnan, In this tutorial you’re going to learn how to implement push notifications in Android as an app feature using React Native and Firebase.
    #pushnotification #android #reactnative #codewithadnan
    What Are Push Notifications?
    Push notification is a small message that users receive on a device. They differ from regular pop-ups because they will appear on the device whether or not the user is currently using the site or app that the notification is tied to.
    Push notifications work for both browsers and apps. For browsers, push notifications can show up no matter what site a user is on, as long as they’ve opted in to push notifications. They work very similarly for apps, however, they can pop up on a mobile device at any time, regardless of whether the user is on the app.
    Notification In IOS Link:
    • Push Notification In R...
    Follow me on Facebook:
    / 12cadeveloper
    Tropical House Music | SEA by Alex-Productions | / @alexproductionsnocopy...
    Music promoted by www.chosic.com...
    Creative Commons CC BY 3.0
    creativecommon...
    If you like this video, Please Likes, Comments, Subscribe to support us...
    Thanks.
    Starting with React Native #codewithadnan @code with adnan

Комментарии • 118

  • @theycallmekingmo
    @theycallmekingmo 2 года назад +1

    Simple to follow but my app kept crashing after integrating your method...can i share my code with you maybe i am missing something

  • @harshitparkar
    @harshitparkar Год назад +19

    Remove IOS Tutorial from the title 🙂

  • @effiongbenjamin3305
    @effiongbenjamin3305 5 месяцев назад +4

    Am I the only one dancing to your music

  • @ifeanyiakomas1722
    @ifeanyiakomas1722 Год назад +3

    This was actually the first tutorial that made my app notification work😎😎

  • @maheshbirajdar4855
    @maheshbirajdar4855 Год назад +5

    What you did between 7:41 - 7:43 frame, code looks different..

    • @ipanxbread
      @ipanxbread Год назад

      yeah, he also did something to his App.js offscreen.. how is this a tutorial..

  • @muthiulhaqhaq3835
    @muthiulhaqhaq3835 10 месяцев назад +1

    Thank you Sir, simple and straight forward (like)

  • @B8dya
    @B8dya Год назад +3

    you show that you get old token and new from this function but where you invoke that?
    help

  • @andresescorcia6587
    @andresescorcia6587 Год назад +2

    Mil gracias por tu aporte, excelente video, funcionando al dia de hoy 10-04-2023

    • @alejandrocardenas1570
      @alejandrocardenas1570 Год назад

      Hola, me podrías indicar donde encontraste la server key?

    • @andresescorcia6587
      @andresescorcia6587 Год назад

      @@alejandrocardenas1570 en settings la tuerca azul, después le das habilitar a la cloud messaging API legacy

  • @alllyrics4321
    @alllyrics4321 10 месяцев назад +1

    Great tutorial!!!, sadly it seems on android a console.log is not enough to show the push notification.
    Edit: The permission request was missing, now everything works fine. Good tutorial.

  • @nahalasignature6684
    @nahalasignature6684 Год назад +2

    but why notification doesnt appear when app is in foreground??..please share the code for that too

  • @banguyen3368
    @banguyen3368 Год назад +1

    I have done it like this. Receive notification but not show pop-up in Android with react native

  • @hassannassif143
    @hassannassif143 2 года назад +2

    I did every step, but I cant receive the message as a notification from fcm, any help please.

  • @PatrickDReis
    @PatrickDReis Год назад +1

    Thanks! What theme are you using?

  • @akashsr6619
    @akashsr6619 10 месяцев назад +1

    The push notification is come in my console only not in my physical device

  • @kylepham3650
    @kylepham3650 Год назад +1

    we can use notifee library to show noti.

  • @razaaku
    @razaaku Год назад +1

    hi is it possible when i received notification my mobile screen turn to On?

  • @jeffersoninacio5513
    @jeffersoninacio5513 2 года назад +1

    In my case it's almost working... I send the push notification but my device only receive on display if I open the app. Do you have any ideia why?

  • @dongnez
    @dongnez Год назад +1

    Thanks, very simple and straightforward👍

  • @aereowatcher9131
    @aereowatcher9131 Год назад +1

    work perfectly! thx

  • @chinmayk3409
    @chinmayk3409 Год назад +1

    Hi Notification permission not enabling , thats why notification not coming in my mobile , can you please tell how to popup permision of push notification in android . Thanks in advance

  • @ThanhPham-se6gu
    @ThanhPham-se6gu Год назад +1

    When I use the messaging.requestPermission() method the system modal doesn't display so I can choose "Allow / Dont allow". Some time ago it did but recently it stopped and just returned authorization: 1. On iOS it displays the modal but not on Android.
    Can you elaborate on this? :) Thanks in advance.

  • @mr.programer4918
    @mr.programer4918 2 года назад +1

    Thanks Buddy its help me to solve my problem 🙂

  • @akinjidesleek
    @akinjidesleek 11 месяцев назад +2

    hi, where exactly are you calling the GetFCMToken function?

    • @whynesspower
      @whynesspower 7 месяцев назад

      Its being called when the token is retrieved from AsyncStorage and is found to be expired. See the video again

  • @TheGinoooo
    @TheGinoooo Год назад +1

    Hi! Great video, but could you please keep explaining how to proceed for iOS?

  • @sortionline
    @sortionline 2 года назад

    It Works!, Thank you Adnan.

  • @BajoQTI
    @BajoQTI 2 года назад +1

    You can add a notification as "mailbox" and when you open a notification, the open notification opens in the "mailbox"

  • @poojarajendran9616
    @poojarajendran9616 2 года назад +1

    Could you please show a demo of how navigate to a screen on clicking the notification ?

    • @CodeWithAdnan
      @CodeWithAdnan  2 года назад

      I thint its easy to understand in video

  • @saxenavedant61
    @saxenavedant61 2 года назад +1

    Thanks a lot just have a question is the app in running in the background or in quit state I want to open the app and navigate to a specific screen in react native how to do that?
    I am trying to build a call app and using push notifications for in coming calls so I have to open the app and navigate tp in call dailer screen whenever I receive a call ie receive a notification.
    How to do that ?

    • @saxenavedant61
      @saxenavedant61 2 года назад

      Upadte: I want to open app on setBackgroundMessageHandler of rnfirebase and reroute to a specific page.
      How to do that in index.js

  • @pradeep9137
    @pradeep9137 2 года назад +1

    No notification im getting when implementing this, i followed every step still it doesn't work . Pls help on this asap

    • @CodeWithAdnan
      @CodeWithAdnan  2 года назад

      Send me screenshot on social media account that’s mentioned in detail

  • @davitgigauri6053
    @davitgigauri6053 2 года назад +1

    thank you very much. With me everything works on both platforms though it does not work on disconnected Android

    • @CodeWithAdnan
      @CodeWithAdnan  2 года назад

      brother it’s just example not proper work and when you disconnect your device it’s definitely not work because you are in debugging mode.

  • @poojarajendran9616
    @poojarajendran9616 2 года назад +1

    Got it working.. thanks :)

  • @saigoarashi5895
    @saigoarashi5895 Год назад +1

    it's work, thank you.

  • @jvanderhorst2011
    @jvanderhorst2011 2 года назад +1

    please explain for the n00bs like me thx

  • @charbel4090
    @charbel4090 2 года назад +1

    AsyncStorage is deprecated

  • @relaxforever8881
    @relaxforever8881 9 месяцев назад +1

    Aoa can you link the git repo thanks in advance

  • @marioantonio5019
    @marioantonio5019 2 года назад +1

    in order to send real notifications to my real costumers, I'll stick with this test website or head directly to firebase console push notifications section?

    • @CodeWithAdnan
      @CodeWithAdnan  2 года назад

      you just use only cloud messaging using firebase, save your notification in real time database or firestore. you have no need of this helper website to push notifications.

  • @luxmailsundhar
    @luxmailsundhar 2 года назад +1

    GetFCMToke function not working. console not print(console.log(fcmtoken, 'old token');) how to solve this issue sir.

    • @fotios4902
      @fotios4902 2 года назад

      do you call it
      export const requestUserPermission = async () => {
      const authStatus = await messaging().requestPermission();
      const enabled =
      authStatus === messaging.AuthorizationStatus.AUTHORIZED ||
      authStatus === messaging.AuthorizationStatus.PROVISIONAL;
      if (enabled) {
      console.log('Authorization status:', authStatus);
      getFCMToken();
      }
      };

    • @charbel4090
      @charbel4090 2 года назад +2

      same

  • @B8dya
    @B8dya Год назад +3

    where you invoke this GetFCMToken() method?

    • @amiramaouch2774
      @amiramaouch2774 Год назад

      did u figure that out? i don't know why he skipped this part !

    • @B8dya
      @B8dya Год назад

      @@amiramaouch2774 yes, sure
      I invoke it near requestUserPermission and getCustomerDevice functions

  • @robinildefonsoildefonso8512
    @robinildefonsoildefonso8512 2 года назад +2

    where did you generate you server key??

  • @pradeep9137
    @pradeep9137 2 года назад +2

    integrated like you did , but when i push notfications , it doesnt appear , i followed everything , but it doesnt work, pls help on this stuck here for 2 days

  • @anuradhamate5116
    @anuradhamate5116 Год назад +1

    Hello can u please share git repo

  • @dileepnagendra8199
    @dileepnagendra8199 Год назад +1

    Thanks

  • @drfarwa-physiotherapist
    @drfarwa-physiotherapist Год назад +1

    Good

  • @kaunghtethein3322
    @kaunghtethein3322 2 года назад +1

    thank you. can you do the same in ios simulator?

    • @CodeWithAdnan
      @CodeWithAdnan  2 года назад +1

      Yes i can do in ios but require paid apple account. InshAllah in future i upload that video. 😊

    • @CodeWithAdnan
      @CodeWithAdnan  2 года назад

      and thanks for your supporting

    • @kaunghtethein3322
      @kaunghtethein3322 2 года назад +1

      @@CodeWithAdnan thanks for the reply brother

    • @itachileiva
      @itachileiva 2 года назад

      @@CodeWithAdnan why require a paid apple account? send push notificacion in backgroun for ios i have to pay?

  • @keremerguner4111
    @keremerguner4111 2 года назад

    Thank you so much :)

  • @TechWithYasir
    @TechWithYasir Год назад +1

    where is ios, why you distract with your caption

  • @yogeshk6671
    @yogeshk6671 2 года назад +3

    where do you render pushnotification_helper.js its not show in the vid , my app wont run the function inside pushnotification_helper.js without rendering. could you help please

    • @NickKubde
      @NickKubde 2 года назад +2

      Yes same question by my side also

    • @Enkeii93
      @Enkeii93 2 года назад

      Just add that to App.js:
      import {requestUserPermission, NotificationListener} from "./src/utils/pushnotification_helper"
      useEffect(() => {
      requestUserPermission();
      NotificationListener();
      }, [])

    • @yourjhay
      @yourjhay 2 года назад

      up

    • @poojarajendran9616
      @poojarajendran9616 2 года назад +1

      in App.js file he have used a similar import statement " import {requestUserPermission,notificationListener} from './src/utils/pushNotification_helper'; "

    • @abdur-rahmaanmohabbat600
      @abdur-rahmaanmohabbat600 2 года назад +1

      He skips that part for some reason. go to 9:42 and you can see the change he made to app.js, he imported request permission and ran it in the app through useeffect

  • @luisvanegasdev95
    @luisvanegasdev95 2 года назад +1

    Hello, great video, would you make one with an expo?

  • @darshanchudasama7834
    @darshanchudasama7834 Год назад +1

    Only android not ios edit your caption

  • @vishalahir9179
    @vishalahir9179 2 года назад +1

    bro can i get git repo for this demo ?

    • @CodeWithAdnan
      @CodeWithAdnan  2 года назад

      Link i think in description

    • @vishalahir9179
      @vishalahir9179 2 года назад

      @@CodeWithAdnani can't found link in description so plz give me in replay

  • @reinaldorequena530
    @reinaldorequena530 2 года назад +1

    hi, and IOS config?

  • @thanhcao5348
    @thanhcao5348 2 года назад

    anyone crashing app when push notification?

  • @Prajjwalgupta-hs1gw
    @Prajjwalgupta-hs1gw Год назад +1

    mera nhi chal para

  • @WaqasAli-tn3pe
    @WaqasAli-tn3pe Год назад +1

    no IOS setup

  • @saadniazi8039
    @saadniazi8039 2 года назад +1

    good

  • @anass9487
    @anass9487 2 года назад

    Barra yarhem waldik

  • @FranciscoHermoso-ii8cn
    @FranciscoHermoso-ii8cn Год назад +1

    Excellent. so you have for ios

  • @mickey01
    @mickey01 Год назад +1

    pls use code formatter

  • @sandeeprana3128
    @sandeeprana3128 2 года назад +1

    Can you provide with same notification for ios

    • @CodeWithAdnan
      @CodeWithAdnan  2 года назад

      Yes i can but still active i will be upload in future

  • @awais882s
    @awais882s Год назад

    JazakAllah

  • @devabra_com
    @devabra_com 10 месяцев назад +1

    good luck good video

  • @IamYourFudder
    @IamYourFudder Год назад +1

    Where can you get the server key on the latest firebase cloud messaging? xD

    • @IamYourFudder
      @IamYourFudder Год назад +1

      Nevermind, I figured it out

    • @kokenyszabolcs4898
      @kokenyszabolcs4898 Год назад

      @@IamYourFudder I have the same issue, how did you get the server key?

    • @kokenyszabolcs4898
      @kokenyszabolcs4898 Год назад

      Solved. I had to enable the Cloud Messaging API (Legacy)