Android GCM doesn't work with wifi networks when 3G network is available

非 Y 不嫁゛ 提交于 2019-12-07 07:15:12

问题


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.


回答1:


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:

  • 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)


来源:https://stackoverflow.com/questions/14563916/android-gcm-doesnt-work-with-wifi-networks-when-3g-network-is-available

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!