我有我的iOS角度/电容应用程序,它能够通过电容事件接收和管理推送通知:
// Method called when tapping on a notification
PushNotifications.addListener('pushNotificationActionPerformed',
async (action: ActionPerformed) => {
await this.router.navigateByUrl('url/to/go')
console.log('logic done);
}
);日志确认我的操作已经完成,但在我的应用程序中,在我点击UI的任何部分之前,什么都不会发生。然后,路由将正确地更新到目的地。在iPhone 6 iOS 12.5中测试
这怎么可能呢?
发布于 2021-08-16 13:32:53
我自己找到了解决办法:出于某种原因?无法解释我需要在ngZone服务中包装路由器语句:
this.ngZone.run(() => this.router.navigateByUrl(path));
如果有人能解释这些,我会很感激的:)
https://stackoverflow.com/questions/68650803
复制相似问题