0
我做在離子應用如下:離子FCM推送通知觀察到的不發出
- 當用戶登錄,訂閱他們的用戶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
發送到我自己的話題通知到達(幾分鐘後),但我從來沒有看到在控制檯任何東西,無論是從應用程序外,和應用程序內。
我在做什麼錯?