Firebase Notification not received on device when sent via cURL/PHP

后端 未结 4 954
故里飘歌
故里飘歌 2021-01-02 10:16

I have an iOS app which is live on the app store. I am able to send push notifications to iOS devices which have the app installed, but only when I send them from the Fireba

4条回答
  •  孤独总比滥情好
    2021-01-02 10:44

    From the Firebase documentation you have the choice of using either data or notification in the message payload. But when you use data, you have the responsibility of handling the receipt of the notification yourself. In other words it will not be sent straight away to your app client. You handle it in the didReceiveRemoteNotification: for ios and onMessageReceived() in case of Android.

    If however you use notification in the payload, firebase will send the message straight away to your client App.

    That is why you will not receive the message(in case you used data) even if your curl request tells you it has succeeded in making the request.

提交回复
热议问题