The Push Notifications Guide for Ionic & Capacitor

Поделиться
HTML-код
  • Опубликовано: 13 июл 2020
  • Learn to add Push notifications to your Ionic app with Capacitor and Firebase. We will integrate both iOS and Android in this tutorial!
    🔥Learn Ionic faster with the Ionic Academy: ionicacademy.com/
    💎 Get the Built with Ionic Book: builtwithionic.com/
    🎉 Get my Practical Ionic Book: devdactic.com/practical-ionic/
    #############################
    👨‍💻Want to read instead of watch?
    Here's the full Ionic tutorial: devdactic.com/push-notificati...
    🤷‍♂️Want more Ionic tutorials?
    There you go: devdactic.com/
    ⚡️Take my 7 Day Ionic Crash Course
    ionicacademy.com/ionic-crash-...
    #############################
    ❤️You can also find me...
    on / simongrimm_
    on / schlimmson
    on / devdactic
    #############################
  • НаукаНаука

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

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

    Hi Simon!
    Great video!
    I spend a couple of hours to understand all process and then found your tutorial.
    Thank you for clear explaining and showing all details there
    You save me many time!

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

      Great to hear Yurii, always happy to help :)

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

    Thanks Simon, these tutorials and Angular tutorials with Ionic in particular are really helpful considering just how many things can go wrong when you're battling through the code alone! Glad to see things are slowly getting easier with the Ionic workflow

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

    Hey Simon, great video. 🚀👍🏻👏🏻 I love Ionic

  • @kayodeolaniyi3566
    @kayodeolaniyi3566 3 года назад +1

    Thank you for this, I was able to get it running on android, hope to test IOS soon. God willing

  • @vipinmishramd
    @vipinmishramd 4 месяца назад +1

    Thank you Simon for this tutorial. this video is too understanding for beginner. Thank you 😊😊

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

    Fantastic tutorial man! Can you make some video about send notifications by ionic?

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

    Thank you for great guide! Also thanks for the hint with the router.

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

    Thank you, Simon. You help a lot!

  • @vldslv_plvk
    @vldslv_plvk 8 месяцев назад

    Hi Simon!
    Thanks for the tutorial!
    Quick question: is it possible to use a custom sound for @capacitor/push-notifications?

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

    Amazing Guide!! thank you sooo much

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

    Huge thanks for your tutorial, iOS part is not intuitive at all but you made it as simple as it could be. 👍

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

    Thank you very much, from Colombia! :D

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

    Thanks for the video. It is very helpful. In my case, the app is crashing when I receive something and when the app in background, nothing happens. Do you have any clue?

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

    Hi Simon, Great video. How can I add a push notification generated from local app when this is on background?

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

    Great video, thanks for sharing!

  • @anroswell
    @anroswell 3 года назад +1

    Ohh Simon thank you for this tutorial, it's great, i had a problem when i compile to Android Studio, capacitor create 2 package. any way thank...

  • @eddielim7274
    @eddielim7274 3 года назад +1

    Thanks Simon for this video. How can I show a badge in app icon when the app is close not running in background and foreground for android? I have added ["badge", "sound", "alert"] in the capacitor config but it doesn't work. Thanks for your help.

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

    Hi Simon, can I do the same thing with cordova instead?

  • @freddo1kenobi713
    @freddo1kenobi713 3 года назад

    What version for capactior push are you using here Simon? I have been trying to add my event listeners to my project and they only fire for android(ios does not fire onReceived or onAction) using ios core 2.4.1 package. They don't fire on either notifications received or opened, no matter what state the app is in(foreground, background, dead).

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

    :) any way to do the action buttons? like in the local notification? using action performed listener to redirect depending on some state conditions but gotta use some explicitly labeled buttons, for user friendliness.

  • @biswajitkar237
    @biswajitkar237 3 года назад +1

    Hi Simon,
    Great tutorial. But we have a small issue.
    Whenever the app is open or it's showing in recent apps, the notifications are coming successfully.
    But when the user closes the app means it's not in the recent apps, he is not receiving the notifications.
    What are we missing here. Can you please help?

  • @somchithnguyen7517
    @somchithnguyen7517 3 года назад +1

    thanks you for this useful tuto.

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

    thank you for the video!!

  • @ciprian-danielturca3067
    @ciprian-danielturca3067 2 года назад +1

    Hi, and thank you for the tutorial!
    Sometimes the "pushNotificationActionPerformed" listener is not triggered. When the app is closed, after we get a notification, the app is open and the listener is working fine. When the application is in the background and we open a notification, the listener is not triggered. In most cases it works even when the application is in the background. But sometimes it's not triggered, and we don't know what can be the problem
    . Do you have any idea or suggestion why sometimes the listener it’s not triggered? Any help would be great. The problem occured when app rest in background for longer time (a day for example). Thank you!

  • @GreenWebSevilla
    @GreenWebSevilla 4 месяца назад

    Great and easy tutorial! How can we get the token on Android to test the push notifications?

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

    all videos is a good, thanks sir.

  • @manuelmariscal7286
    @manuelmariscal7286 3 года назад

    Hello Simon! One question please, i am struggling with this ionic native plugin cordova, it says i didnt install the the plugin but it is! How to solve this error?

  • @ferranmuntada2454
    @ferranmuntada2454 4 месяца назад

    Hi Simon! Can u make a video implementing push notifications with action buttons? I didn't see any information about it !
    Thank you!

  • @ebrahimtawaf9018
    @ebrahimtawaf9018 3 года назад +1

    hi Simon, you are a great person thank you so much for your tutorials they are very helpful and well explained.
    I am trying to make push notifications form firebase but i got an error TypeError: Cannot read property 'requestPermission' of undefined
    TypeError: Cannot read property 'requestPermission' of undefined.
    This error popup at the first when i try to ask for notification permission do you have any idea what could be the problem is, here is my packages:
    "@capacitor/android": "^3.0.1",
    "@capacitor/app": "^1.0.1",
    "@capacitor/core": "2.4.7",
    "@capacitor/haptics": "^1.0.1",
    "@capacitor/ios": "^2.4.7",
    "@capacitor/keyboard": "^1.0.1",
    "@capacitor/status-bar": "^1.0.1",
    Thank you.

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

    Great tutor. Enjoying of your videos. But having issue on attaching image to push on IOS. Any information on that?

  • @azzedinemassinissa9230
    @azzedinemassinissa9230 3 года назад

    Hello, thank you for this, how to push universal link ?

  • @omarmcC2011
    @omarmcC2011 10 месяцев назад

    Do you have something for the latest onesignal plugin version? I mean the Beta 5.0.0. I just updated my project to that plugin version but mehotds seem to be quite different.

  • @LatenightDev
    @LatenightDev 3 года назад +1

    Thankyou sir

  • @DevarshiDavessj4
    @DevarshiDavessj4 3 месяца назад

    Hi Simon, can you please create a video on Notification badge on App icon? facing a lot of issues there...

  • @lucasmunaro1093
    @lucasmunaro1093 4 месяца назад

    Hi Simon, your video helped me a lot to make the push work.
    But on iOS I'm having problems making sounds and displaying the badge.
    I did all the configuration as in the video, using presentationOptions but it still didn't work.
    I'm using quasar, vue3 and capacitor5, do you have any idea what it could be?
    On Android it worked perfectly!

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

    Hello hi sir,
    we can send push notification using REST API to specific user mobile by using ionic cordova and firebase.plz I request to given me some solutions regarding this.
    thank you.

  • @manuelmariscal7286
    @manuelmariscal7286 3 года назад

    Also do you think doing a PWA can send notifications?

  • @Raffzahn12
    @Raffzahn12 3 года назад

    Great Video! How would you handle routing to a details page if you need to perform some logic upon starting the application (authentication for example)?

    • @galaxies_dev
      @galaxies_dev  3 года назад

      Good question. You could manually perform an authentication check in the push handling event and then route once the authentication is done.
      If this can't be done in the background and you need user input on login, perhaps store the push information inside a service (or local storage) and then check this value after every login to see if you have any "stored" events that you need to handle!

  • @monthewilfriedtutorials5423
    @monthewilfriedtutorials5423 10 месяцев назад

    Hi Simon. Great Tutorial but i'm battling since fews days now. I receive notifications when the app is closed, in background or in forground. Works great. But when the app is open and i tap on it the pushNotificationReceived event is not triggered as compared to when it is closed. How can i solve this issue please?

  • @dlodeprojuicer
    @dlodeprojuicer 3 года назад

    Thanks!!! By far the most clear Push Notifications tutorial....
    1) Any idea when generate command in ionic/cli will be available for Ionic Vue?
    2) Where can one find an Ionic Vue tutorial for the services steps?

    • @galaxies_dev
      @galaxies_dev  3 года назад

      1) no sorry, not involved in the Vue development (but a first RC is out!)
      2) Also no idea :D

  • @VirajGamage
    @VirajGamage 3 года назад

    Hi Simon, Thank u for the great tutorial. Can I pls know how to store the generated FCM in firebase in order to use it later to send push.

    • @galaxies_dev
      @galaxies_dev  3 года назад

      You could simply write it to a collection for which you use the user unique ID as the document and then the FCM stored inside that document!

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

    Thanks!

  • @pcpark7621
    @pcpark7621 3 года назад

    @Simon Grimm
    Thank you Simon
    I have one question for push notification.
    I "turn off" push notification of android Apps in android settings
    But when a return value is received, it's always true.
    can you tell me why?
    ==================
    const permissionResult = await PushNotifications.requestPermission();
    return permissionResult.granted;

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

    what about that notification icon? it was white dot on android. how to fix that sir?

  • @tikini
    @tikini 4 месяца назад

    Thank you for the video But i have a problem, I use Ionic 7 and Capacitor 5 and after many tests, I found that the PushNotifications.addListener('registration'... function doesn't fired.
    Can you help me, please?

  • @malteschafer5250
    @malteschafer5250 3 года назад

    Hey everybody, i've got it working like i want to but is it possible to request date like "sent/received/opened" from firebase? Help would me mush appreciated.

  • @manuelmariscal7286
    @manuelmariscal7286 3 года назад

    Not recommended to start doing a Capacitor project and then Ionic right? ;)

  • @sicollins935
    @sicollins935 3 года назад

    Great tutorial Simon - helped me out a lot. Couple of burning questions I'm trying to find answers for:
    1. If user turns off Push Notifications through the OS app settings is there an event we can listen for, so we can then revoke the push token on our backend system?
    2. Is there an event we can listen for when a user clears the Notification without tapping on it when app is in background? i.e. so we can then clear badge count.
    3. Can you point me in the right direction for getting Push analytics working through Firebase?
    Thanks

    • @galaxies_dev
      @galaxies_dev  3 года назад

      1) No not that I know of. But your backend will receive an error when sending the push I think, perhaps you can handle it from there.
      2) Also never saw an event for that, but you could query them from within the app to see if they were removed: capacitorjs.com/docs/apis/push-notifications#getdeliverednotifications
      3) Haven't used that before :/

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

    Hi simon nice clear video (like all your other video).
    I work on a project with asp.core api + web angular + ionic mobile app. It is necessary to send notifications from the internal asp server to company smartphones.
    For security policies both the server and the mobile phones are in the local network and do not have access to the internet.
    Question1: is there a way to do this without using online services like firebase or azure etc?
    Question2: what can I use to send notifications from asp server to internal angular website?
    thank you very much .

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

      Thanks Sandro!
      1) I'm actually not sure. For example iOS push basically goes through Apple servers before reaching your phone - guess that won't even be possible in your case :/
      2) You could use web push probably, but at least for iOS this won't work inside a PWA (only Android right now), but same like before not sure if that would even be possible..

  • @ryanholton961
    @ryanholton961 3 года назад

    Great tutorial! A few questions...
    1. I want to send out custom notifications based on a schedule that a user can select from within an app
    2. How could I get a notification to trigger automatically based on an API? For instance, I want to send a notification to an individual Firebase account based on the data that user has requested to see notifications for?
    3. Are persistent notifications possible? What happens if a user’s phone restarts or their app updates

    • @galaxies_dev
      @galaxies_dev  3 года назад

      You need to handle the logic on your backend for scheduling. So you would have to schedule some kind of job to send out the push in the future, depending on your choice of backend (a cron job, or scheduled inside Firebase cloud functions - many possibilities)
      What you mean by persistent? Whenever you receive a push you can store the data if you need to access it later, otherwise the information is gone anyway, and a restart or update isn't all that different then!

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

    Hi Simon
    your videos are always very useful and engaging. Thanks
    A question about push notifications.
    Is it possible in some way to link the push notification to the user logged in to the app and not to the device? Maybe, alternatively:
    1. generate a token with the data of the logged in user
    2. generate a token, delete it on logout; generate a different one on new login ...
    3 ... any idea?
    Although absurd, it is possible that the user logs out and the device is used by another user who logs in. I have a shared device situation.
    I would like to use pushes to sync the data with the backend and the data is user based.
    Thank you very much
    Monica

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

      Hmm I understand but not sure if the token you generate upon login will be unique or just the device info again.. If you store it in your DB linked to the user than a user that has logged out would never get a push, so you would remove it in the DB on device logout. Perhaps that's the only way to do it :/

  • @manuelmariscal7286
    @manuelmariscal7286 3 года назад

    Hello Simon! Thank you as always! By the way, move all the project for the first time to iOS and now i'm having an error on build because of this, does it sounds you? The library i am using is: cordova-plugin-fcm-with-dependecy-updated (Ionic 5 + cordova). Dont know how to face it, it doesnt work what i found googling:
    ** BUILD FAILED **
    The following build commands failed:
    CompileC ..../manel/Documents/ionic_projects/project/platforms/ios/Project01/Build/Intermediates.noindex/Project01.build/Debug-iphonesimulator/Project01.build/Objects-normal/x86_64/FirebaseAnalyticsPlugin.o /Users/manel/Documents/ionic_projects/project/platforms/ios/Project01/Plugins/cordova-plugin-firebase-analytics/FirebaseAnalyticsPlugin.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
    CompileC ..../manel/Documents/ionic_projects/project/platforms/ios/Project01/Plugins/cordova-plugin-fcm-with-dependecy-updated/AppDelegate+FCMPlugin.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
    (2 failures)
    xcodebuild: Command failed with exit code 65
    [ERROR] An error occurred while running subprocess cordova.
    Thank you in advance sir ;)

  • @josephnanakofiboakye2603
    @josephnanakofiboakye2603 3 года назад

    Hello. Can't seem to find it but from which minute is the android aspect? Can't tell

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

    Hi Simon! is it true that push notification for IOS do not need the developers program anymore?

  • @jared4670
    @jared4670 3 года назад

    Could someone please tell me how to enables lights on my notification? And how to modify the colour of the light? I have looked high and low for this configuration but cannot locate it. .....

  • @berndeisermann3246
    @berndeisermann3246 3 года назад

    Hi Simon, very great video. What I have to do to see in firebase console if a user has opened a notification? Here I see always 0%.

    • @galaxies_dev
      @galaxies_dev  3 года назад

      Hmm I don't know about an easy way, but you should usually store the device token in the DB so then you know if someone accepted push!

  • @anillip1
    @anillip1 3 года назад

    Thanks Simon, will AWS SNS will be advised which in-turn use Firebase ?

    • @galaxies_dev
      @galaxies_dev  3 года назад +1

      Haven't used AWS SNS so far, but you can create push notifications on many different ways!

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

    does anyone know of a tutorial that uses capacitor push notifications and azure notification hubs? not sure why it's so hard to find

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

    Hi Simon, I tried to follow up step by step, but when build on android i founded error :
    C:\xampp\htdocs\SIPADU
    ode_modules\@capacitor\push-notifications\android\src\main\java\com\capacitorjs\plugins\pushnotifications\MessagingService.java:9: error: cannot access Service
    public class MessagingService extends FirebaseMessagingService {
    ^
    class file for android.app.Service not found
    Please what wrong with my code

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

    hey simon i followed your video step by step but i got an error
    node_modules/@capacitor/push-notifications/ios/Plugin/PushNotificationsHandler.swift:32:44: error build: Value of type 'CAPPlugin' has no member 'getConfig'
    i am using xcode 14 and ionic 6.20.1 and node 16.17.0
    can you please help .
    Thanks

  • @jamespeterson7824
    @jamespeterson7824 3 года назад

    @Simon grimm great explanation. How will you subscribe to a TOPIC in this?

    • @tolutronics
      @tolutronics 3 года назад +1

      you can use the capacitor fcm plugin ..
      see here: www.npmjs.com/package/@capacitor-community/fcm

  • @Martin-kj1od
    @Martin-kj1od 2 года назад

    Great tutorial. I would like to ask what is the correct way to handle token refresh. The token gets outdated in time right ? Is is correct way to register for push notification every time user logs in and then compare the token with the one stored in database and update it if it differs ?

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

      The device token should mostly be unique and won't get invalid, it's not like a JWT. Also, there is no way to "unregister" so you would have to manually remove the information from Firebase where you stored it.
      You can read more about the topic in this discussion: github.com/ionic-team/capacitor/issues/1777

  • @thepowerofmusic01
    @thepowerofmusic01 3 года назад

    Hello Simon!
    Still not working on iOS? Can you help us to solve it please?
    Thank you! Regards

  • @toxaq
    @toxaq 3 года назад

    Can you do notification actions?

  • @user-ff9lc4zu5d
    @user-ff9lc4zu5d 2 месяца назад

    I'm Developing a restaurant app. how to create notification that contains "Your order is ready" when the order done by restaurant ? what is the correct API's to use??

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

    Thank you Simon. You are the best. ActionPerformed event doesn't fire if the app was killed, so when user tap on notification iOS just open my app and I unable to retrieve additional payload data (detailId) for open proper detail page. How can I mange this issue?

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

      I have the same issue. I checked the Capacitor docs and says "This plugin does support data-only notifications, but will NOT call pushNotificationReceived if the app has been killed. To handle this scenario, you will need to create a service that extends FirebaseMessagingService, see Handling FCM Messages." and that redirect to Firebase docs and explains to create a service but it is in Java or Kotlin, but nothing about Ionic/Angular, so it's really confusing and I don't know what to do to resolve the issue

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

    Hi , i'm using "@capacitor/push-notifications": "^4.1.2" for implement push notification in android app but facing issue like if app open that time i can't able to get any event on tap of that notification can you help me how i can retrieve click tapping event when app is open. Currently i'm using below eventlistner for notification.
    // Method called when tapping on a notification
    await PushNotifications.addListener('pushNotificationActionPerformed',
    async (notification: ActionPerformed) => {
    console.log('Push action performed- ', notification);
    }
    );

  • @nbis23
    @nbis23 3 года назад

    Nice tutorial however when i close the app and then i received a notification when i tapped it does not redirect. But when i just hide the app the redirection works.

  • @belovedambav7025
    @belovedambav7025 3 года назад

    Thanks so much Simon. Please I want to know how to include an external JS in my ionic 5 app. Tried multiple methods, but it's not working.

    • @galaxies_dev
      @galaxies_dev  3 года назад

      I think you can just add the script to the index.html and then use the name of your function in your code!

  • @maximilianfink5848
    @maximilianfink5848 3 года назад +1

    Thank you so so much!

    • @galaxies_dev
      @galaxies_dev  3 года назад

      You're welcome!

    • @maximilianfink5848
      @maximilianfink5848 3 года назад +1

      @@galaxies_dev After resetting my Mac and reinstalling everything, when I try to build the app in Xcode, I get "cannot find InstanceID in scope", as can be seen in the video at 14:12...
      Any ideas why this could be the case?

    • @devzona
      @devzona 3 года назад

      @@maximilianfink5848 I'm wrong too. How to solve ?

    • @maximilianfink5848
      @maximilianfink5848 3 года назад

      @@devzona I still could not figure it out, might try to remove and set up the iOS part on the whole. I'll let you know how it goes

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

    Hello Simon, getting this : Module '"@capacitor/core"' has no exported member 'PushNotification'
    could you suggest about it ?

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

      Yes, since Capacitor all the plugins are in their own package, so now it's "npm install @capacitor/push-notifications"

  • @mauricioklipe4669
    @mauricioklipe4669 3 года назад

    Have you had any experience using Capacitor with the Salesforce SDK? This SDK was written for Cordova, but it did not work properly syncing with cap.

  • @yunotazombie
    @yunotazombie 3 года назад +3

    Great video, I don't know why I can see the notifications with the app closed but if the app its open I don't receive anything neither I see them on the log

    • @devzona
      @devzona 3 года назад +1

      // Show us the notification payload if the app is open on our device
      PushNotifications.addListener('pushNotificationReceived',
      (notification: PushNotification) => {
      // alert('Push received: ' + JSON.stringify(notification));
      console.log('Push received: ', notification);
      let alertRet = Modals.alert({
      title: notification.title,
      message: notification.body
      });
      }
      );

  • @videodr.9402
    @videodr.9402 3 года назад

    Hi Simon, You do always an amazing job. I have a question please can you tell me how to trigger firebase push notifications from my API?

    • @galaxies_dev
      @galaxies_dev  3 года назад

      You can integrate the admin package of Firebase and use the messages from there, see here: firebase.google.com/docs/cloud-messaging/send-message

    • @videodr.9402
      @videodr.9402 3 года назад

      @@galaxies_dev Thank you soo much, you made my day :)

    • @videodr.9402
      @videodr.9402 3 года назад

      @@galaxies_dev, Also I have a request if it's possible can you please create an amazing tutorial on push notifications using Firebase and Server API on Ionic 5? I will be very thankful to you.

  • @surajshetty817
    @surajshetty817 3 года назад

    Hey simon great video! I have one doubt, how to stop getting notifications from fcm when the user changed the settings to stop notification.

    • @galaxies_dev
      @galaxies_dev  3 года назад

      You can either toggle this in the device settings then or remove the FCM ID your previously stored for that user!

    • @jared4670
      @jared4670 3 года назад

      Save the FCM token along with is_notifications_enabled: boolean for example to your server-side database. That way when you loop through the array of users, you do a check first to see if their push notifications are enabled. If they aren't, then you skip that user.

  • @wx8699
    @wx8699 9 месяцев назад

    TQ for your tutorial. i would like to know is it possible to open app when receive the notification from firebase? in android or ios TQVM

    • @galaxies_dev
      @galaxies_dev  9 месяцев назад

      The user has to click on a message, you can't just force open an app!

  • @jean13666
    @jean13666 3 года назад

    Thanks for the video. What can be done do unregister (in order to stop receiving notifications?

    • @galaxies_dev
      @galaxies_dev  3 года назад +1

      I think you should just unregister the listeners: capacitorjs.com/docs/apis/push-notifications#removealllisteners

    • @jean13666
      @jean13666 3 года назад

      @@galaxies_dev Thanks. I will check it out.

  • @m1kecrosoft
    @m1kecrosoft 4 месяца назад

    how much money do you need to invest to get this working ?

  •  3 года назад

    Great video as always!
    Is there any way to send push notification from inside ionic? For example, an administration dashboard that sends push notifications.
    Also where do I find the documentation for Capacitor.platform?

    • @galaxies_dev
      @galaxies_dev  3 года назад +1

      Well at some point you would need secret keys in some ways to send a push, and that should always be inside a server. For a dashboard, you could create something like an admin app which is connected to your own server, so you could trigger a push from the app, but in fact the push would still be triggered by the server. So it's not that easy!

    •  3 года назад

      @@galaxies_dev Thanks! This make Sense. I Will try to use the firebase server functions.

    • @tolutronics
      @tolutronics 3 года назад

      you can use http to send push notifications using firebase api

  • @JayPatel-jk8iu
    @JayPatel-jk8iu 3 года назад

    Hey Simon, as always you videos is awesome and it helps a lot... but i have a question how can i send cloud based notifications like if today is my birthday then it sends me a push notification on my device......

    • @galaxies_dev
      @galaxies_dev  3 года назад +1

      Hmm you might need something like a cron job inside a server that checks the date each day and then triggers a push notification!

    • @JayPatel-jk8iu
      @JayPatel-jk8iu 3 года назад

      @@galaxies_dev yes exactly can you guide me?

  • @AruljothySundramoorthy
    @AruljothySundramoorthy 3 месяца назад

    It'll help more if you could added the code snippet :)

  • @harmanbhutani
    @harmanbhutani 3 года назад

    Amazing work Simon. I am able to get push notications following this tutorial but I observed that I only get notifications when app is running in background not when user is currently using app. Can you help me in solving this issue?

    • @devzona
      @devzona 3 года назад

      // Show us the notification payload if the app is open on our device
      PushNotifications.addListener('pushNotificationReceived',
      (notification: PushNotification) => {
      // alert('Push received: ' + JSON.stringify(notification));
      console.log('Push received: ', notification);
      let alertRet = Modals.alert({
      title: notification.title,
      message: notification.body
      });
      }
      );

    • @devzona
      @devzona 3 года назад

      // Show us the notification payload if the app is open on our device
      PushNotifications.addListener('pushNotificationReceived',
      (notification: PushNotification) => {
      // alert('Push received: ' + JSON.stringify(notification));
      console.log('Push received: ', notification);
      let alertRet = Modals.alert({
      title: notification.title,
      message: notification.body
      });
      }
      );

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

    Hi Simon. I'm getting this error message can you help me with it [Firebase/Messaging][I-FCM012002] Error in application:didFailToRegisterForRemoteNotificationsWithError: remote notifications are not supported in the simulator

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

    Well nobody replied to my question a year ago and now I have encountered another issue after nearly two years of using Ioninc Push Notificaitons. The Token is now expired and there are no methods within the Ionic docs to perform a token refresh.

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

    Hi Simon, thank you for the tutorial!
    If have an issue with the router push to the detail page: when the app is closed in the background and gets opened with a push by id, the router push is not working and only the app (startpage) opens.

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

      Sounds strange, but maybe Angular is not yet ready to run the router? Or is there any log in the console?

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

      @@galaxies_dev actually i cannot test push notifications when the app is build over the simulator or a plugged in device, so i have no console information to debug. I think the problem is, that the app first needs to start and then sets the listeners for the pushNotificationActionPerformed afterwards which is too late to perform the router push..

  • @user-gp7qn8ki9u
    @user-gp7qn8ki9u 11 месяцев назад

    That was a great tutorial. But seems like `pushNotificationActionPerformed` no longer is triggered for android emulator. I can't get it to work and seems like people have had issues with this. I am using this with Angular 16 and Standalone components. Have tried debugging it in multiple ways, but can't seem to find a solution.

  • @xianchen1935
    @xianchen1935 3 года назад +1

    Hello, the @capacitor/core Plugin is deprecated, are there any alternatives to connect with Firebase cloud messaging with capacitor?

    • @galaxies_dev
      @galaxies_dev  3 года назад

      Yes, you simply need to install those packages on their own and not import them from the Capacitor core!

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

    buen video, tuve un problema no se si a alguien más le sucede, me llega la notificación pero no se despliega la alerta emergente.... solo queda en la sección de notificaciones cuando aparece. ¿Alguien sabe porque?

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

    Hello, @Simon Grimm! Could you please share with us if there is a way to make the push notifications work if the device is locked and the phone sleeps (the screen is black)?

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

      That's exactly what push notifications are for - they arrive at the OS level so you should see them on the lock screen anyway!

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

      @@galaxies_dev I agree but I followed the whole tutorial and they work perfectly only if the device is not locked. If I lock the device and the screen goes black, they popup only if I press the lock button to unlock the phone.

  • @369-davian
    @369-davian 3 года назад

    Hi simon g. From dominican republic, have a question. sorry if write bat in english but, I'am crazy try to make push notification using ionic/react and not ionic/angular please if push notification not have suport on ionic/react please let me know, and stop to try to do that. trhanks love your video. hope can you respond me

    • @galaxies_dev
      @galaxies_dev  3 года назад +1

      I haven't worked with Ionic React but I think it should work basically the same!

  • @jamespeterson7824
    @jamespeterson7824 3 года назад

    @simon grimm, great tutorial.
    Just one security question, what if user has logged out and he gets a background notification and when he clicks on that GUARD WILL restrict him from entering the page and tell him to login..but now when user logs in ,how to redirect him to the path ( which we have set inside the notification click method )..how to achieve this?

    • @galaxies_dev
      @galaxies_dev  3 года назад +1

      Storing the state of navigation when using a guard is a bit more tricky, might do a tutorial on this - good idea!

    • @jamespeterson7824
      @jamespeterson7824 3 года назад

      @@galaxies_dev thanks for the reply..looking forward getting this scenario covered in your tutorial ...

  • @anroswell
    @anroswell 3 года назад +1

    Simmon i have one question, i can choose what user send the notification??

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

    Hi Simon, how are you? In Capacitor V3 not working this same, for me not working the package @capacitor/push-notifications :/. Did you work with that package?

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

      Don't think I've tried it with v3 but not sure what should have changed :/

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

    on android device notification show in notifications tray but does not popup even in your tutorial it does not pop up how to fix this

  • @danielnavarro8758
    @danielnavarro8758 3 года назад

    hello simon a query the screen oritation in capacitor is equal to cordova to implement it?

    • @galaxies_dev
      @galaxies_dev  3 года назад +1

      Yeah you can query it the same way!

    • @danielnavarro8758
      @danielnavarro8758 3 года назад

      @@galaxies_dev ok, as in the documentation it is with a capacitor and the example is within androiManifest .. and in cordova it is within app.component.ts, that's why it is my question

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

    Awesome!!! But can you create a video that can send a push notification with the two devices

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

      You should never send from one device to another as this requires a secret key, which you should keep on a server!

  • @mschannel829
    @mschannel829 3 года назад +1

    Hello Simon. Your videos are great. I followed the steps of your tutorial and I could receive Android messages, however in iOS 13 I dont receive any message. I think that my iOS configuration is right because the App obtains a token, and also, because when I set up Firebase I connected the App and I receved a notification (in firebase platform), saying that the connection with the device was successfull or the configutation was right. Do you know, whether there are Problems to integrate Push Notifications in iOS13? thank you!

    • @galaxies_dev
      @galaxies_dev  3 года назад

      Perhaps there is an issue with the latest version as another comment also had problems on iOS :/

    • @mschannel829
      @mschannel829 3 года назад +1

      @@galaxies_dev hi Simon. I installed the last version of capacitor and I start to receive push notifications when the app is in background, but in foreground I do not receive any notification.

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

      @@mschannel829 that's an old ios limitation as far as I remember even with cordova and FCM there was the same issue

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

    so you meant to say that in order to display push notification in android and ios, I have to download and install a file to my capacitor app? so whats the difference of switching cordova to capacitor if its still the same?

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

      Capacitor and Cordova have different philosophies, this can't be described just by the example of one plugin!

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

    Hi Simon thanks for the Tutorial. I've had a few issues with this on Cap 3 I've changed all the imports to fall in line with the updated Capacitor spec, i get a token, but never receive messages on iOS, all the apple certs seem fine ( tried using p12s and just the key file, and both at same time ) no matter what i try, nothing comes in

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

      Did this work for you before Cap 3?

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

      @@galaxies_dev honestly, this is the first time using Firebase, I was using OneSignal until i started a new project where Firebase looked like a shiny new route to take rather than OneSignal from an implementation perspective it seems much simpler then OneSignal, so I never actually got to try on Pre-Cap-3 projects. BUT - having had a fiddle with it, it seems that I had two Firebase projects running and I was trying to deploy notifications from the wrong platform... coz I'm basically an idiot with a tight deadline.. - Thanks for the videos Simon, your content really helps me.

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

      @@galaxies_dev Yeah same for me. I tried all the step that were shown in the video and updated the delegate file from the new capacitor v3 document. Not receiving the notification at all.

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

      Did you find any solution for the mentioned problem ?

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

    Great tutorial Simon, thanks for this guide.
    I have been able to make iOS push notifications works !
    Sadly, it's not working on android :/, registration doesn't work (got a MISSING_INSTANCEID_SERVICE error)
    EDIT : problem solved, it was because my phone didn't have play store (Huawei and all their new smartphones don't have Google Play Services)
    There is still a part in the documentation I don't understand. It's evoking *$firebaseMessagingVersion* variable in *variables.gradle* file. I was wondering if it was up to us to add this variable ourselves in the file or capacitor is supposed to generate it automatically ? Personnaly I don't have it by default.
    If anyone is around and has the answer to my question, I would be grateful.

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

      Capacitor usually won't add any variables like Cordova did in the past so you need to handle those settings yourself in the native projects!