4
votes

I put in reference this Link

I implemented it it works but am facing troubles: first sometimes I need to restart the android emulator so the push notification could be delivered when the emulator is restarted the push notification work properly. after a while the push notification does not work and it need about 15 min to the push notification to get delivered. if I restart the emulator the push notifications get delivered and so on...

what do you think the problem here?

2
the GCM service take about 10s and delivery is not guarantee. The emulator restarting has no relation with receiving push notification. Insure server retry mechanism in error case. - Anis BEN NSIR
In my case, it was not router/firewall issue. When running on physical device, I got notification/cloud message without any delay, however, when running on an emulator, only the first notification arrives with ~30min delay; however, once I received the first one, from there one, no delay. I believe it has to do with how heartbeat is handled on an emulator. As suggested by Satyendra, I just turn off wife/data of the emulator and turn right back on and it works. As Yogesh suggested, its not a solution, but works. - Sung

2 Answers

2
votes

Its your wifi router probably, check the description here

https://play.google.com/store/apps/details?id=com.andqlimax.pushfixer

I opened an issue to google here: https://productforums.google.com/forum/#!category-topic/nexus/connecting-to-networks-and-devices/fslYqYrULto

and they agree there is a TCP timeout on some conditions.

1
votes

if you are expecting a notification but there a huge delay in android emulator. You can perform following step to get instant notification.

Turn off the mobile data in Emulator then turn it on again, you will get the notification as soon as you turn it on hope this helps :)