【发布时间】:2021-10-29 03:08:19
【问题描述】:
如何捕获此异常以进行 Web 实现,或继续进行 Web 推送通知。
如果有人可以帮助我,那将非常有帮助。 ☺
我已经实现的代码:
PushNotifications.addListener('registrationError', (error: any) => {
console.log('Error on registration: ' + JSON.stringify(error));
});
PushNotifications.addListener('pushNotificationReceived', (notification: PushNotification) => {
console.log('Push received: '
+ JSON.stringify(notification.data));
this.openToast(notification.data);
});
PushNotifications.addListener('pushNotificationActionPerformed', (notification: PushNotificationActionPerformed) => {
console.log('Push action performed: '
+ JSON.stringify(notification.notification.data));
this.navigate.navigateForward([
'profile',
notification.notification.data.identification,
]);
});
只是想知道如何在ionic using capacitor 中为网络实现PushNotification。如果有任何插件,或者至少我可以处理这个异常。
如果有任何进一步的说明,请告诉我
【问题讨论】:
-
stackoverflow.com/a/61666423/2039326,即下面的答案解决了我的问题,无需捕获异常
标签: angular push-notification ionic4 capacitor ionic5