2017-09-27 100 views
0

我做在離子應用如下:離子FCM推送通知觀察到的不發出

  1. 當用戶登錄,訂閱他們的用戶ID話題
  2. 當一個推送通知到達時, 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

發送到我自己的話題通知到達(幾分鐘後),但我從來沒有看到在控制檯任何東西,無論是從應用程序外,和應用程序內。

我在做什麼錯?

回答

0

從Firebase消息傳送通知不起作用。 然而,使用SDK我必須補充:

click_action: "FCM_PLUGIN_ACTIVITY",

這是使用指南,但我錯過了