The Push Notifications Guide for Ionic & Capacitor

  Рет қаралды 100,922

Simon Grimm

Simon Grimm

Күн бұрын

Пікірлер: 265
@kennedystephen
@kennedystephen 5 ай бұрын
If we make changes directly to platform files (under ios and android), wouldn't that mean we'd have to keep those folders under source control as well?
@AlexisDessard
@AlexisDessard 10 ай бұрын
Thanks! (again, because I always watch this same video every 3 months for a different app)
@galaxies_dev
@galaxies_dev 10 ай бұрын
Thank you Alexis!!
@yuriileso773
@yuriileso773 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 3 жыл бұрын
Great to hear Yurii, always happy to help :)
@divineperspicaciousness
@divineperspicaciousness 2 жыл бұрын
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
@galaxies_dev
@galaxies_dev 2 жыл бұрын
You're very welcome!
@vipinmishramd
@vipinmishramd 11 ай бұрын
Thank you Simon for this tutorial. this video is too understanding for beginner. Thank you 😊😊
@galaxies_dev
@galaxies_dev 11 ай бұрын
Glad to hear that!
@simonazzopardi3762
@simonazzopardi3762 4 жыл бұрын
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?
@JitenderRaghav
@JitenderRaghav 3 жыл бұрын
Hello Simon, getting this : Module '"@capacitor/core"' has no exported member 'PushNotification' could you suggest about it ?
@galaxies_dev
@galaxies_dev 3 жыл бұрын
Yes, since Capacitor all the plugins are in their own package, so now it's "npm install @capacitor/push-notifications"
@AlexisDessard
@AlexisDessard 2 жыл бұрын
Huge thanks for your tutorial, iOS part is not intuitive at all but you made it as simple as it could be. 👍
@galaxies_dev
@galaxies_dev 2 жыл бұрын
Glad it helped!
@microvirus
@microvirus 4 жыл бұрын
what about that notification icon? it was white dot on android. how to fix that sir?
@wakikuk
@wakikuk 2 жыл бұрын
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
@yunotazombie
@yunotazombie 4 жыл бұрын
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 4 жыл бұрын
// 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 }); } );
@xianchen1935
@xianchen1935 3 жыл бұрын
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!
@sviluppoprogettoautomazion2746
@sviluppoprogettoautomazion2746 4 жыл бұрын
Hi Simon, can I do the same thing with cordova instead?
@gausmohammadshaikh8739
@gausmohammadshaikh8739 4 жыл бұрын
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.
@emreaka3965
@emreaka3965 Жыл бұрын
Thank you, Simon. You help a lot!
@galaxies_dev
@galaxies_dev Жыл бұрын
Glad to hear that Emre!
@davidsosa5940
@davidsosa5940 5 ай бұрын
Hi Simon, help with showing the notification when the app is on the foreground ? Thanks
@stasoline
@stasoline Жыл бұрын
Great video, thanks for sharing!
@galaxies_dev
@galaxies_dev Жыл бұрын
You are welcome!
@IshchenkoVitaliy
@IshchenkoVitaliy 2 жыл бұрын
Thank you for great guide! Also thanks for the hint with the router.
@galaxies_dev
@galaxies_dev 2 жыл бұрын
Glad I could help!
@eddielim7274
@eddielim7274 4 жыл бұрын
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.
@darshanbhut6714
@darshanbhut6714 4 жыл бұрын
What about the push notifications receive event i have try too much to get receive notification from firabase as above implementation but it work properly when app is closed or in background stage but not working on foreground/open or visible stage so any idea about how to resolve it..thanks..
@galaxies_dev
@galaxies_dev 4 жыл бұрын
During my tests I definitely got an event for both, open or closed app! Put a log everywhere and try again, this should definitely be possible!
@devzona
@devzona 4 жыл бұрын
// 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 }); } );
@omarmcC2011
@omarmcC2011 Жыл бұрын
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.
@grandvilletanbunan6435
@grandvilletanbunan6435 10 ай бұрын
Hi Simon, thank you for the tutorial. Now I can Push Notification from FCM, but is there any possible way to trigger Push Notification right after we insert Document to a Collection in Firestore Database?
@ciprian-danielturca3067
@ciprian-danielturca3067 3 жыл бұрын
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!
@GujaratiSafar
@GujaratiSafar 2 жыл бұрын
all videos is a good, thanks sir.
@galaxies_dev
@galaxies_dev 2 жыл бұрын
Glad you like them!
@id-aiHa-Ezio
@id-aiHa-Ezio 4 жыл бұрын
Hey Simon, great video. 🚀👍🏻👏🏻 I love Ionic
@pauldean9146
@pauldean9146 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 3 жыл бұрын
Did this work for you before Cap 3?
@pauldean9146
@pauldean9146 3 жыл бұрын
@@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 ?
@kennedystephen
@kennedystephen 5 ай бұрын
@Simon - if we make changes directly to platform files (under ios and android), wouldn't that mean we'd have to keep those folders under source control as well?
@mertellialti
@mertellialti 3 жыл бұрын
I'm trying to follow your instructions but is it possible that some of them are out-dated? Like in 13:41 there is no such URL exist. And there is no such code exist in AppDelegateSwift file (the if block doesn't exist)
@galaxies_dev
@galaxies_dev 2 жыл бұрын
Yes the code we need to change inside the iOS project might have changed slightly for Capacitor 3, check here: capacitorjs.com/docs/guides/push-notifications-firebase#add-initialization-code
@mertellialti
@mertellialti 2 жыл бұрын
@@galaxies_dev thank you Simon! It helped to me.
@mrsmola2354
@mrsmola2354 Жыл бұрын
Hello, i try to figure it out for Ionic Vue project, but with no success. Im stuck at 14:57 min, when you are creating services and page with that command, because in ionic vue it doesnt exist. Can you somehow help me how to continue? Thanks!
@galaxies_dev
@galaxies_dev Жыл бұрын
AFAIK there is no CLI generate command for Vue or React so you have to create those files manually following the Vue conventions!
@tikini
@tikini 11 ай бұрын
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?
@eliabekun
@eliabekun 4 жыл бұрын
Fantastic tutorial man! Can you make some video about send notifications by ionic?
@محمودجبالي-م7ز
@محمودجبالي-م7ز 9 ай бұрын
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??
@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..
@DevarshiDavessj4
@DevarshiDavessj4 10 ай бұрын
Hi Simon, can you please create a video on Notification badge on App icon? facing a lot of issues there...
@yebadokpogodson7163
@yebadokpogodson7163 4 жыл бұрын
Thk you simon for your video , but it's not working for me .. I have this error : Default FirebaseApp is not initialized in this process com.aardra.cloud. Make sure to call FirebaseApp.initializeApp(Context) first. ! DO you have any idea
@galaxies_dev
@galaxies_dev 4 жыл бұрын
Yes, did you put the initializeApp() like described in the video inside your app.module?
@Kamleshyadav-yk7kr
@Kamleshyadav-yk7kr 3 ай бұрын
Thanks a lot, it is working like charm😊
@lucasmunaro1093
@lucasmunaro1093 10 ай бұрын
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!
@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); } );
@solarmatica
@solarmatica 2 жыл бұрын
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 2 жыл бұрын
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
@ferranmuntada2454
@ferranmuntada2454 11 ай бұрын
Hi Simon! Can u make a video implementing push notifications with action buttons? I didn't see any information about it ! Thank you!
@jared4670
@jared4670 2 жыл бұрын
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.
@monthewilfriedtutorials5423
@monthewilfriedtutorials5423 Жыл бұрын
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?
@jean13666
@jean13666 3 жыл бұрын
Thanks for the video. What can be done do unregister (in order to stop receiving notifications?
@galaxies_dev
@galaxies_dev 3 жыл бұрын
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.
@AmitKamble-q2v
@AmitKamble-q2v Жыл бұрын
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.
@andresflg
@andresflg 4 жыл бұрын
Thank you very much, from Colombia! :D
@galaxies_dev
@galaxies_dev 4 жыл бұрын
Glad it helped!
@zauberschurke4012
@zauberschurke4012 2 жыл бұрын
Amazing Guide!! thank you sooo much
@galaxies_dev
@galaxies_dev 2 жыл бұрын
Glad you enjoyed!
@vldslv_plvk
@vldslv_plvk Жыл бұрын
Hi Simon! Thanks for the tutorial! Quick question: is it possible to use a custom sound for @capacitor/push-notifications?
@allwyndsouza5633
@allwyndsouza5633 2 жыл бұрын
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
@mschannel829
@mschannel829 4 жыл бұрын
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 4 жыл бұрын
Perhaps there is an issue with the latest version as another comment also had problems on iOS :/
@mschannel829
@mschannel829 4 жыл бұрын
@@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 3 жыл бұрын
@@mschannel829 that's an old ios limitation as far as I remember even with cordova and FCM there was the same issue
@y0urh0mew0rk
@y0urh0mew0rk 3 жыл бұрын
:) 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.
@GreenWebSevilla
@GreenWebSevilla 11 ай бұрын
Great and easy tutorial! How can we get the token on Android to test the push notifications?
@biswajitkar237
@biswajitkar237 3 жыл бұрын
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?
@anroswell
@anroswell 4 жыл бұрын
Simmon i have one question, i can choose what user send the notification??
@sathithyayogi99
@sathithyayogi99 3 жыл бұрын
use FCM notification
@MrSteveHaran
@MrSteveHaran 2 ай бұрын
Hi Simon, I've been battling with push notifications within an installed PWA on ios complaining about the firebase SDK not being compatible. Is the capacitor a solution/requirement to get push notifications working on a PWA installed on ios?
@MrSteveHaran
@MrSteveHaran 2 ай бұрын
(note - not an app store app)
@Ashutoshsingh-s1p
@Ashutoshsingh-s1p Жыл бұрын
can make new push notification using capacitor using android
@kayodeolaniyi3566
@kayodeolaniyi3566 4 жыл бұрын
Thank you for this, I was able to get it running on android, hope to test IOS soon. God willing
@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
@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!
@sebasA
@sebasA 3 жыл бұрын
Hi Simon, Great video. How can I add a push notification generated from local app when this is on background?
@wx8699
@wx8699 Жыл бұрын
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 Жыл бұрын
The user has to click on a message, you can't just force open an app!
@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;
@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?
@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
@tiagoschmittc
@tiagoschmittc 2 жыл бұрын
I am getting "remote notifications are not supported in the simulator". Do you know how to solve it? I am using XCode v13.3. Thanks!
@galaxies_dev
@galaxies_dev 2 жыл бұрын
I guess you simply can't test push notifications inside the simulator!
@DevbyDech
@DevbyDech Жыл бұрын
Hi Simon! is it true that push notification for IOS do not need the developers program anymore?
@ryanholton961
@ryanholton961 4 жыл бұрын
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 4 жыл бұрын
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!
@hamzaahmed2724
@hamzaahmed2724 3 жыл бұрын
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
@josephnanakofiboakye2603
@josephnanakofiboakye2603 3 жыл бұрын
Hello. Can't seem to find it but from which minute is the android aspect? Can't tell
@OptimisticTechHub
@OptimisticTechHub 2 жыл бұрын
Great tutor. Enjoying of your videos. But having issue on attaching image to push on IOS. Any information on that?
@sandropecchia1297
@sandropecchia1297 3 жыл бұрын
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 3 жыл бұрын
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..
@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.
@rogerobando4825
@rogerobando4825 3 жыл бұрын
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 3 жыл бұрын
Don't think I've tried it with v3 but not sure what should have changed :/
@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.
@iamkalimorales
@iamkalimorales 3 жыл бұрын
thank you for the video!!
@galaxies_dev
@galaxies_dev 3 жыл бұрын
My pleasure!
@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!
@AruljothySundramoorthy
@AruljothySundramoorthy 10 ай бұрын
It'll help more if you could added the code snippet :)
@anroswell
@anroswell 4 жыл бұрын
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...
@freddo1kenobi713
@freddo1kenobi713 4 жыл бұрын
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).
@joachimheirbrant1559
@joachimheirbrant1559 Жыл бұрын
how do i send a push notification to a user from the application itself. Like for exemple when a user buys a product and i want the seller to get a notification that his product has been sold?
@galaxies_dev
@galaxies_dev Жыл бұрын
As this usually requires secret keys, there should always be some sort of service or backend between that!
@harmanbhutani
@harmanbhutani 4 жыл бұрын
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 4 жыл бұрын
// 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 4 жыл бұрын
// 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 }); } );
@jamespeterson7824
@jamespeterson7824 4 жыл бұрын
@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 4 жыл бұрын
Storing the state of navigation when using a guard is a bit more tricky, might do a tutorial on this - good idea!
@jamespeterson7824
@jamespeterson7824 4 жыл бұрын
@@galaxies_dev thanks for the reply..looking forward getting this scenario covered in your tutorial ...
@NathanIVV
@NathanIVV 3 жыл бұрын
does anyone know of a tutorial that uses capacitor push notifications and azure notification hubs? not sure why it's so hard to find
@berndeisermann3246
@berndeisermann3246 4 жыл бұрын
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 4 жыл бұрын
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!
@m1kecrosoft
@m1kecrosoft 11 ай бұрын
how much money do you need to invest to get this working ?
@mauricioklipe4669
@mauricioklipe4669 4 жыл бұрын
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.
@galaxies_dev
@galaxies_dev 4 жыл бұрын
No haven't used that yet :/
@thepowerofmusic01
@thepowerofmusic01 3 жыл бұрын
Hello Simon! Still not working on iOS? Can you help us to solve it please? Thank you! Regards
@ebrahimtawaf9018
@ebrahimtawaf9018 3 жыл бұрын
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.
@somchithnguyen7517
@somchithnguyen7517 4 жыл бұрын
thanks you for this useful tuto.
@galaxies_dev
@galaxies_dev 4 жыл бұрын
Glad it was helpful!
@danielnavarro8758
@danielnavarro8758 4 жыл бұрын
hello simon a query the screen oritation in capacitor is equal to cordova to implement it?
@galaxies_dev
@galaxies_dev 4 жыл бұрын
Yeah you can query it the same way!
@danielnavarro8758
@danielnavarro8758 4 жыл бұрын
@@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
@eliabekun
@eliabekun 3 жыл бұрын
All running ok, but it's not receiving the messaging. It's registrating, generating token, only is not receiving the messaging. Can you help me?
@Raffzahn12
@Raffzahn12 4 жыл бұрын
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 4 жыл бұрын
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!
@mohdtaqi6780
@mohdtaqi6780 2 жыл бұрын
Capicator push notification's notificationReceived listener didn't get fired when app is kill or in background I need that to show the total Badge count and count of different type of notification like chat notification count or product post count, One possible workaround is to implement getDeliveredNotification and get the notification count to show inside different part of app. That word fine with on iOS But On android getDeliveredNotification don't give additional data so not able to count different type of notification. I'm wondering how you show badge count when app is in background. Can you please help Or any other who know how to achieve this.
@galaxies_dev
@galaxies_dev 2 жыл бұрын
I think normally you can directly update the badge count with the data of the push message itself, not even by reacting to it from the app. But I know there have been open issues around this in the past for Capacitor, not sure if there's yet a good solution :/
@JayPatel-jk8iu
@JayPatel-jk8iu 4 жыл бұрын
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 4 жыл бұрын
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 4 жыл бұрын
@@galaxies_dev yes exactly can you guide me?
@แบงค์-จ8ศ
@แบงค์-จ8ศ 3 жыл бұрын
error TS2305: Module '"@capacitor/core"' has no exported member 'PushNotificationToken'. all of 3 pushnotification is import from @core/cap failed :(
@galaxies_dev
@galaxies_dev 3 жыл бұрын
With Capacitor 3 you directly import the package, not from core anymore! See here: capacitorjs.com/docs/apis/push-notifications
@belovedambav7025
@belovedambav7025 4 жыл бұрын
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 4 жыл бұрын
I think you can just add the script to the index.html and then use the name of your function in your code!
@surajshetty817
@surajshetty817 4 жыл бұрын
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 4 жыл бұрын
You can either toggle this in the device settings then or remove the FCM ID your previously stored for that user!
@jared4670
@jared4670 4 жыл бұрын
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.
@jared4670
@jared4670 4 жыл бұрын
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. .....
@nbis23
@nbis23 4 жыл бұрын
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.
@BigStav
@BigStav 3 жыл бұрын
This is a good tutorial but since Capacitor 3 a lot of it doesn't work any more :( Will you consider redoing it for Capacitor 3?
@galaxies_dev
@galaxies_dev 3 жыл бұрын
Actually only the imports from the new PushNotifications packaged have changed, all the rest of the setup is still completely the same!
@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 ;)
How to Build a Native App from Angular Projects with Capacitor
29:39
How to Build an Ionic 5 Calendar with Modal & Customisation
26:53
Ozoda - Alamlar (Official Video 2023)
6:22
Ozoda Official
Рет қаралды 10 МЛН
How to Cache API Responses with Ionic & Capacitor
30:10
Simon Grimm
Рет қаралды 9 М.
Push Notifications in iOS Apps with Firebase Cloud Messaging
27:37
Rishab Kattimani
Рет қаралды 15 М.
React Native Push Notifications with Expo and Edge Functions
26:48
Ionic & Capacitor for Building Native Mobile Apps - Full Course for Beginners
3:10:14
How to use Ionic In App Purchase with Capacitor
24:13
Simon Grimm
Рет қаралды 23 М.
How to use SQLite in Ionic with Capacitor
15:17
Simon Grimm
Рет қаралды 19 М.
Push notifications with Firebase messaging - Flutter
14:28
HeyFlutter․com
Рет қаралды 112 М.
DHH discusses SQLite (and Stoicism)
54:00
Aaron Francis
Рет қаралды 105 М.
Ozoda - Alamlar (Official Video 2023)
6:22
Ozoda Official
Рет қаралды 10 МЛН