【发布时间】:2018-03-08 21:39:03
【问题描述】:
我在离子应用程序中执行以下操作:
- 当用户登录时,订阅他们的用户 ID 主题
-
当推送通知到达时,
console.log某事。this.authState.subscribe((state) => { if (state) { this.fcmPush.subscribeToTopic(state.uid); this.fcmPush.onNotification().subscribe(notification => { if (notification.wasTapped) { console.log('Received in background', notification); } else { console.log('Received in foreground', notification); } }); } });
来源:https://github.com/AmitMY/ionic-starter-firebase/blob/master/src/app/app.component.ts#L118
向我自己的主题发送通知到达(几分钟后),但我从未在控制台中看到任何东西,无论是来自应用程序外部还是应用程序内部。
我做错了什么?
【问题讨论】:
标签: ionic-framework ionic2 cordova-plugin-fcm