Vue send push notification with Firebase

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

КОМЕНТАРІ • 56

  • @ablegreimerguzmanperez7250
    @ablegreimerguzmanperez7250 10 місяців тому

    Salvaste mi vida, mi carrera universitaria, todo viejo... MUCHAS GRACIAS!!!

    • @benixal
      @benixal  10 місяців тому +1

      Thank you so much for your kind words! I'm glad the video was helpful to you.

  • @kennyjeancarloarevaloreyes6976
    @kennyjeancarloarevaloreyes6976 6 місяців тому +2

    The notifications in the foreground and according to the plan only reach me through the console, everything is fine, but the notification window is not shown and when I close the page the sale does not appear, what is the reason?

  • @tyresewatchthis8025
    @tyresewatchthis8025 8 місяців тому

    Bro you have no idea how much you helped me. Thanks a lot, I subscribed, please make more Vue.js + Firebase videos

    • @benixal
      @benixal  7 місяців тому

      Thank you so much! I'm glad the video helped you. More Vue.js + Firebase content is on the way, so stay tuned! 🚀

  • @chill-hot-stream
    @chill-hot-stream 11 місяців тому

    nice tutorial it helped me today with nuxt3 integration

    • @benixal
      @benixal  11 місяців тому

      Thanks for your comment, Glad it helped 😀 👍

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

    Thank you so much! you help me and your instruction very, very clear i subbed ofc

  • @hieuNguyen-om8sg
    @hieuNguyen-om8sg Рік тому +1

    thank you so much for the guide, i got it to work the same as you at 9:15 but my project uses laravel as back-end so is there a code or place you know that i can read up on how to set up on that side ? im using axios to connect between the two, the firebase setting does not have code for php it would seems

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

      Thanks for your comment, I'm glad it was helpful!
      I think there is no official Firebase Admin SDK for PHP.
      Instead, you need to use REST:
      firebase.google.com/docs/reference/fcm/rest/v1/projects.messages/send
      You can use cURL in PHP to interact with it
      Check out this Gist:
      gist.github.com/benixal/59c5be11d1f67502698decf0c80e2cf2

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

    You are the boss ! thank you

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

      Thank you so much! I'm glad the video was helpful for you.

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

    Thank you so much! I've watched many videos and could not understand how to do this with firebase's docs

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

      Thank you for your kind words! I'm glad you found the video helpful.

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

    THANK YOUUUU LOVE YOU BROOOO 💥💥💥💥💥💥💥

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

      Thanks! 🙌 Glad the video was useful to you.

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

    Does it works in PWA's? Using VUE 2.

  • @HossamHossam-r9h
    @HossamHossam-r9h 2 дні тому

    iam implementing these steps in nuxt 3 but i get that error (A bad HTTP response code (404) was received when fetching the script.) any help please

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

    background notifications aren't showing up, I get the console log when I focus the page, but no notification popup

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

      Firebase service worker does not show background notifications when the page is focused. Try using this simple javascript service worker: gist.github.com/benixal/80440dcec49f71c4423f428e27e7ad6f#file-firebase-messaging-sw-js

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

    Thank you so much!

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

    This is great, thanks. Now what if I want to use Capacitor to turn this Vue.js app into an ios/android mobile app?
    Will it just work, or is there an entirely different process?

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

      Thank you!
      I'm not familiar with Capacitor , I'm not sure

    • @04Condor
      @04Condor Рік тому

      worked for you with a capacitor?

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

      same question "worked for you with a capacitor?" i'm doing app with vue.js (capacitor) do you find any solution to send push notification via firebase?

    • @ameename4425
      @ameename4425 11 місяців тому

      @@benixal you are currently running in browser. What if we build an android .apk file and install apk in my mobile. Will the notification still be sent?

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

    do you know why this method only works on chrome? i tested on safari and firefox they both don't work

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

      For Firefox:
      "I tested this method on Firefox and did not encounter any issues. Could you please provide more information on the error you are seeing in the console?"
      For Safari:
      "The push API may not work on older versions of Safari. To send push notifications on Safari, you may need to use the Apple Push Notification Service (APNs). However, according to Apple, Safari 16 and newer versions will support the push API. I have not tested this yet."
      firebase.google.com/docs/web/environments-js-sdk#browsers
      caniuse.com/push-api

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

      @@benixal thanks for the reply, my bad. on firefox its probably because i tested it on localhost still, i read somewhere it says has to be on https. thanks

  • @MAXTangolaos
    @MAXTangolaos 2 місяці тому

    thanks bro

  • @أحمدرمضان-ف6م5ص

    Thank you from here to sky

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

      Thank you for your comment, I'm glad you found the video helpful.

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

    The notification doesn't seems to be received on ios. (standalone/fullscreen mode)
    Do you know why ?

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

      Thanks for letting me know. I haven't tested it on iOS yet.

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

      This is working everywhere, except on ios :(@@benixal

  • @LoVe-iu9rd
    @LoVe-iu9rd Рік тому

    Is target tocken is for only one user or all users ?

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

      Each token is only for one user , but if you want to send message to all users , you can send it to topics :
      firebase.google.com/docs/cloud-messaging/js/topic-messaging

    • @LoVe-iu9rd
      @LoVe-iu9rd Рік тому

      @@benixal thank you

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

    hi
    is it safe to put the file in public where the file has the FCM keys?

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

      Hi! Yes, it's safe to put the file with the public VAPID key in public. Just remember to keep the private key secure and never share it publicly.

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

      @@benixal thanks

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

      @@benixal Sir, is it safe to include the firebase config in service worker?

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

      Yes, it's safe
      The Firebase config, including apiKey, identifies your project; it's not a security risk if known.
      stackoverflow.com/questions/37482366/is-it-safe-to-expose-firebase-apikey-to-the-public
      firebase.google.com/docs/cloud-messaging/js/receive?hl=en&authuser=0#web-namespaced-api

  • @ЯРепетитормобильноеприложение

    Thanks so much!

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

    Thank you, finally managed to get this to work! Is there any way to toggle a "Heads up" notification on Android devices? I can see it in my notification center, but currently it doesnt generate a popup notification or show on lock screen. Any idea? :)

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

      i guess you need to run it on standalone mode (pwa installed on the device)

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

    awesome thanks

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

      Thanks! 😊👍

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

    you are a god friend

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

      Thank you! I'm glad the video was helpful to you.

  • @tiagofarias-ti
    @tiagofarias-ti 11 місяців тому

    Perfect

    • @benixal
      @benixal  11 місяців тому

      You're welcome! 🙌

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

    Hi, thank for your share - thank you very much, i did it, but i have one question, if i standing at localhost web then send noti, i cant get noti instead firebase-admin already push, buts if i go to other url then i get noti, Did i do something wrong ? Many thank you

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

      Hi thanks for your comment , your welcome!
      that's because the Firebase default service worker does not show background notifications when the page is focused.
      (Instead, it sends a payload directly to your app)
      and you need to handle the display within your application:
      onMessage(messaging, (payload) => {
      console.log('Message received. ', payload);
      // Display the message using your app's elements.
      // For example, pop a div or use other UI elements.
      });
      However if you want to show push notifications even when the user is on the focused screen,
      Try using this simple javascript service worker instead of what I did in video:
      gist.github.com/benixal/80440dcec49f71c4423f428e27e7ad6f#file-firebase-messaging-sw-js
      (don't forget to clear the browser cache or update the service worker through devtools for the changes to take effect)

  • @영상-j2c
    @영상-j2c 20 днів тому

    Bro is Steve Wozniak's Father