3G网络可用时,Android GCM不适用于wifi网络 [英] Android GCM doesn't work with wifi networks when 3G network is available

查看:77
本文介绍了3G网络可用时,Android GCM不适用于wifi网络的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Android GCM推送通知上开发应用程序.一切正常.但是,当我的设备使用wifi而不是服务提供商的数据计划时,我无法收到通知消息.就我而言,数据计划是3G,但通知照常发送到设备,但是当设备通过wifi连接时,我无法收到任何通知.

I am developing app on Android GCM push notification. Everything works fine .But I am not able to get the notification message when my device is on wifi rather than on data plan of service provider. In my case data plan is 3G but and notification comes as usual to devices but when device is connected through wifi I am not able to get any notifications.

推荐答案

不是这种情况,我有一个Android应用程序,无论它是通过3G或Wi-Fi连接的,都可以接收GCM推送通知.

Well this should not be the case, I have an android app that receives GCM push notifications regardless it is connected via 3G or Wi-Fi.

我建议如何解决此问题:

What I would suggest to troubleshoot this problem:

  • 从服务器发送推送通知时,请确保包含delay_while_idle,以便立即发送通知.另外,请确保已将time_to_live设置为合理的值(默认为4周)
  • 尝试在您的应用中保持Wi-Fi锁定
  • 使用不同的设备和/或Android版本进行测试(可能是某些硬件/API版本存在问题)
  • When you send the push notification from the server make sure to NOT include delay_while_idle, so the notification get delivered right away. Also make sure you have set time_to_live to a reasonable value (default is 4 weeks)
  • Try to hold a Wi-Fi lock in your app
  • Test with different device and/or Android version (maybe it is a problem with certain hardware/API version)

这篇关于3G网络可用时,Android GCM不适用于wifi网络的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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