相关疑难解决方法(0)

当应用程序处于前台时,Angular 8 firebase 推送通知不起作用

我正在按照此文档在我的 Angular Web 应用程序上实现 FCM。当我发送通知时,它会在应用程序未处于活动状态时成功接收。(接收后台通知)。但是如果应用程序处于活动状态,我就不会收到通知。

按照以下步骤操作:https : //dev.to/mayurkadampro/angular-8-firebase-cloud-messaging-push-notifications-97a

基本上这不会在有新消息时触发

this.angularFireMessaging.messages.subscribe(
(payload) => {
    console.log("new message received. ", payload);
    this.currentMessage.next(payload);})
Run Code Online (Sandbox Code Playgroud)

我错过了什么?

firebase-cloud-messaging angular

7
推荐指数
1
解决办法
4598
查看次数

标签 统计

angular ×1

firebase-cloud-messaging ×1