The Push Notifications Guide for Ionic & Capacitor

The Push Notifications Guide for Ionic & Capacitor

Simon Grimm

4 года назад

96,083 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@ErayTonyali
@ErayTonyali - 07.01.2024 18:43

This is outdated. I commented with the updated version but my comment was deleted for some reason. Also, Simon forgot to show one last part in xcode which was how to add push notifications via Sign & Capabilities. If you do not do this, notifications won't work in iOS.

Ответить
@7588818
@7588818 - 17.11.2023 22:10

Is this still working?

Thanks in advance guys!

Ответить
@vldslv_plvk
@vldslv_plvk - 28.09.2023 23:06

Hi Simon!
Thanks for the tutorial!

Quick question: is it possible to use a custom sound for @capacitor/push-notifications?

Ответить
@wx8699
@wx8699 - 06.09.2023 12:56

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

Ответить
@monthewilfriedtutorials5423
@monthewilfriedtutorials5423 - 02.08.2023 17:16

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?

Ответить
@omarmcC2011
@omarmcC2011 - 31.07.2023 23:00

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.

Ответить
@user-gp7qn8ki9u
@user-gp7qn8ki9u - 13.07.2023 08:20

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.

Ответить
@DevbyDech
@DevbyDech - 20.06.2023 14:44

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

Ответить
@stasoline
@stasoline - 20.05.2023 22:20

Great video, thanks for sharing!

Ответить
@joachimheirbrant1559
@joachimheirbrant1559 - 12.05.2023 18:34

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?

Ответить
@user-sj3uz5nk8f
@user-sj3uz5nk8f - 28.03.2023 14:04

can make new push notification using capacitor using android

Ответить
@paulrackwitz4553
@paulrackwitz4553 - 28.03.2023 13:05

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.

Ответить
@MsDima9999
@MsDima9999 - 07.03.2023 17:52

github links?

Ответить
@HitNataf
@HitNataf - 31.01.2023 07:11

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);
}
);

Ответить
@emreaka3965
@emreaka3965 - 31.01.2023 01:59

Thank you, Simon. You help a lot!

Ответить
@thelucasdkp
@thelucasdkp - 15.11.2022 17:33

Thanks!

Ответить
@GujaratiSafar
@GujaratiSafar - 28.10.2022 08:33

all videos is a good, thanks sir.

Ответить
@DxKim99
@DxKim99 - 19.10.2022 05:24

error: cannot access Service
public class MessagingService extends FirebaseMessagingService {
^
class file for android.app.Service not found

Ответить
@Unscathed_
@Unscathed_ - 10.10.2022 17:23

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

Ответить
@allwyndsouza5633
@allwyndsouza5633 - 15.09.2022 10:44

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

Ответить
@solarmatica
@solarmatica - 19.08.2022 14:23

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?

Ответить
@IshchenkoVitaliy
@IshchenkoVitaliy - 17.08.2022 17:21

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

Ответить
@jared4670
@jared4670 - 16.07.2022 07:46

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.

Ответить
@saq.ib01
@saq.ib01 - 14.07.2022 11:24

Also make a Video on Push notification Icons.

Ответить
@antoineblanquet5508
@antoineblanquet5508 - 30.06.2022 18:23

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.

Ответить
@mohdtaqi6780
@mohdtaqi6780 - 09.06.2022 18:57

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.

Ответить
@isaacnewtonaranas3770
@isaacnewtonaranas3770 - 31.05.2022 03:08

send great notifications

Ответить
@OptimisticTechHub
@OptimisticTechHub - 21.04.2022 00:55

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

Ответить
@tiagoschmittc
@tiagoschmittc - 13.04.2022 22:59

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!

Ответить
@nicoleperez131
@nicoleperez131 - 29.03.2022 20:18

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?

Ответить
@Martin-kj1od
@Martin-kj1od - 16.03.2022 09:36

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 ?

Ответить
@AlexisDessard
@AlexisDessard - 15.03.2022 18:14

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

Ответить
@argelpamintuango1956
@argelpamintuango1956 - 14.03.2022 14:12

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?

Ответить
@zauberschurke4012
@zauberschurke4012 - 14.03.2022 01:28

Amazing Guide!! thank you sooo much <3333

Ответить
@nikolaantonov5833
@nikolaantonov5833 - 07.03.2022 16:23

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)?

Ответить
@layankhater4446
@layankhater4446 - 02.03.2022 13:57

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

Ответить
@NathanIVV
@NathanIVV - 07.01.2022 03:23

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

Ответить
@ciprian-danielturca3067
@ciprian-danielturca3067 - 15.12.2021 02:21

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!

Ответить
@ofcsmsofcsms8324
@ofcsmsofcsms8324 - 02.12.2021 21:07

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

Ответить
@monicasilva399
@monicasilva399 - 26.11.2021 15:03

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

Ответить
@ferrerasalexander
@ferrerasalexander - 24.11.2021 21:49

Useful after 3 days trying :(

Ответить
@user-je1bj1cz6l
@user-je1bj1cz6l - 13.11.2021 14:29

error TS2305: Module '"@capacitor/core"' has no exported member 'PushNotificationToken'.

all of 3 pushnotification is import from @core/cap failed :(

Ответить
@JitenderRaghav
@JitenderRaghav - 29.10.2021 21:56

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

Ответить