How Does WhatsApp overcome the GCM Push notifications delay?

后端 未结 2 1794
孤城傲影
孤城傲影 2021-02-20 15:05

I am trying to use GCM service, Every thing is OK except of the long delay that GCM push notification or deliver payload... some times it take to my App 5 minutes receive notifi

2条回答
  •  一向
    一向 (楼主)
    2021-02-20 16:04

    When sending your notification you could set the priority-parameter to "high".

    From the docs:

    By default, messages are sent with normal priority. Normal priority optimizes the client app's battery consumption, and should be used unless immediate delivery is required. For messages with normal priority, the app may receive the message with unspecified delay.

    When a message is sent with high priority, it is sent immediately, and the app can wake a sleeping device and open a network connection to your server.

    I know this answer comes late, nevertheless if you are still facing this issue (or anyone else) please tell me if it helps.

提交回复
热议问题