如何发送一个高优先级的GCM? [英] How to send a high-priority GCM?

查看:742
本文介绍了如何发送一个高优先级的GCM?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的Nexus 5与Android M preVIEW。

I'm using a Nexus 5 with Android M Preview.

我的问题,我试图解决的是:

My problem that I'm trying to solve is:

网络访问被禁止的,除非你的应用程序接收到一个高优先级   谷歌云消息传递挠痒痒。

Network access is disabled, unless your app receives a high priority Google Cloud Messaging tickle.

我在做什么是:

我把手机变成打盹模式,然后我送推送通知的优先级值10,我期待有一个短暂的瞬间上网,但是这是行不通的。

I put the phone into Doze mode and then I send a push notification with the priority with value 10 and I'm expecting to have internet access for a brief moments, but this is not working.

我应该使用其他类型的通知?有任何文件已经存在?

Should I use other type of notifications? There are any documentation already available?

感谢。

Android的中号的变化: <一href="https://developer.android.com/$p$pview/behavior-changes.html">https://developer.android.com/$p$pview/behavior-changes.html

Android M changes: https://developer.android.com/preview/behavior-changes.html

我发现关于GCM优先级的消息: <一href="https://developers.google.com/cloud-messaging/server-ref">https://developers.google.com/cloud-messaging/server-ref

What I found about GCM priority messages: https://developers.google.com/cloud-messaging/server-ref

推荐答案

设置优先级10是正确的事情,但它不与Android的M按照I / O发布的版本工作。它已被固定,优先级为10的消息会按预期的公开发行。

Setting priority to 10 is the correct thing to do, but it does not work with the version of Android M released at I/O. It has been fixed, and priority 10 messages will work as expected with the public release.

这篇关于如何发送一个高优先级的GCM?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆