android – WhatsApp如何克服GCM推送通知延迟?

我正在尝试使用GCM服务,除了GCM推送通知或提供有效载荷的长时间延迟之外,每件事情都是正常的,有些时候我的App 5分钟会收到通知或有效载荷.
我需要立即交付…
我知道GCM的角色,等到其他设备上线,但在我的情况下,我持有两个设备,他们在线,但我收到延迟通知!

WhatsApp(作为使用GCM的应用程序的示例)如何克服这个问题..并立即发送?

[即(消息类型:打字,在线 – 最后看到)不能延迟…]

GCM延迟推送是已知的问题:this issue
我的问题是:使用GCM的其他应用程序如何克服这个问题

解决方法

发送通知时,您可以将 priority-parameter设置为“高”.

从文档:

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.

我知道这个答案迟到了,但是如果你还在面对这个问题(或任何其他人),请告诉我是否有帮助.

相关文章

AdvserView.java package com.earen.viewflipper; import an...
ImageView的scaleType的属性有好几种,分别是matrix(默认)...
文章浏览阅读8.8k次,点赞9次,收藏20次。本文操作环境:win1...
文章浏览阅读1.2w次,点赞15次,收藏69次。实现目的:由main...
文章浏览阅读3.8w次。前言:最近在找Android上的全局代理软件...
文章浏览阅读2.5w次,点赞17次,收藏6次。创建项目后,运行项...