Google Push Notification Does Not Work In some Networks - android

I have an android application (not in the google play) and it is being used by a company (in their building) right now. It uses Google Push Notifications and actually notifications mean everything. Simply customers press buttons of our own developed device when they need someone and we send notifications to someone authorized.
So we developed and tested it and it works fine here in our network (our office wifi).
Then we tested it in thier network. it works fine, too. So they started to use it.
But sometimes it stops getting notifications (in customer's building) suddenly. In this case if we connect tablet to 3G then it starts again.
To Sum up,
Push notifications work fine when android device is connected my Office Wifi,
Push notifications work fine when android device is connected to 3G,
Push notifications does not work sometimes when android device is connected to our customer Wifi.
and idea will be really helpful thanks.

Your customer WIFI needs some tuning. In order to work properly you need to open the following ports: 5228.5229.5230:
Check this out
The device accesses the GCM servers on ports 5228-5230. If your organization has a firewall that restricts the traffic to or from the Internet, you'll need to configure it to allow connectivity with GCM. The ports to open are: 5228, 5229, and 5230. GCM typically only uses 5228, but it sometimes uses 5229 and 5230. GCM doesn't provide specific IPs. It changes IPs frequently. We recommend against using ACLs but if you must use them, take a broad approach such as the method suggested in this support link.
Hope it helps

Related

Not receiving GCM push notification when VPN is connected in my Android Phone

I am developing an android application & have implemented the GCM push notifications.Everything is working fine.I am sharing the internet connection of my PC in my android phone.I have a proxified net so either I have to connect VPN in my PC & then share that connection in the hot spot or I can share the normal connection & then connect VPN in my android phone.In the first case I'm able to receive the push notifications but in second case I'm not able to receive the push notifications.All other applications works fine in both the case like Whatsapp, Facebook etc.Why its not working for my application?
Everyone in my college uses the second method & I want them to be able to use my application.Help please?
Through process of elimination.
I have managed to get Join by joaoapps, which uses GCM pushes, to work with one small trick.
Use a VPN app with app filter capability (Such as VPN Client Pro, which is what I tested it on, but OpenVPN for Android might work too) to stop Google Player Services (com.google.com.android.gms) being tunneled through VPN connection (not necessarily need to filter your app).
I haven't had any problem sending/receiving pushes afterwards.
Good luck!

How to send notification from one android device to another android device in same wifi network

I want to send notification from one android device (android tv without bluetooth, telephony) to another android device (phone/tablet). Both are on same wifi network. Through the notification, I want to launch an app or open a page in phone/tablet browser.
I went through GCM messaging and also saw some options where we can have a kind of http server on the phone running but could not understand implementation.
Can someone help with idea and if possible, some piece of code as well.
As I need it for demo, so even any hack solution is fine for me :-)
Thanks for any help or reading.
Your best bet as a hacky solution is to do simple Socket connection between two devices. Since they are on same Wifi, it will be simpler and won't have any firewall restrictions.
Avoid GCM, it requires setting up a GCM Server and then complex registration. It also makes your solution dependent upon Internet connectivity & Google ofcourse.
See an example here:
http://android-er.blogspot.in/2014/02/android-sercerclient-example-client.html
Basically one device such as TV can be a socket listener. The phone/tablet can connect to that socket and then you can initiate a notification on either device based on your requirements and data exchange.

GCM push notification does not work correctly when using Wifi network

I successfully integrated my app for receiving push notification using GCM. Its working correctly, I just saw a strange behavior while receiving push notification on one of my android set which is using my wifi network, in the same time others whose are using EDGE or 3G network are receiving notifications correctly. When I try to switch off and switch on the wifi, it receives the pending notification.
I tried opening the ports which normally used by GCM i.e 5228,5229 and 5230 in my router's firewall however with no success.
NB: After seeing this, I tried to configure the app for Parse API and its working as same as GCM so I think it depends upon the network packet receiving or something.
I believe, what you're facing is a known issue about TCP connection between GCM servers and your handset is timing out because of inactivity. Network devices (like your Wi-Fi router, your ISP hardware, etc.) between your handset and GCM servers could kill the TCP connection if no packets are sent every now and then.
There are some workarounds for this which you might try. For example, there are apps on Google Play that modify the default Android behavior and make it update this connection more often, increasing chances that it will not timeout. You could try them and see if it fixes the problem for you.

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

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

Push messages do not come when on 3G?

I implemented push notification system and I noticed that push messages do not ever come when I am on 3G or 4G (mobile Internet).
When I connect to wifi, they come regularly.
Is this behavior bound to Android OS or we can write a code to change it?
I implemented Parse.com 3rd party library. Regardless of myself, I noticed that push messages from other apps do not come unless I am connected to wifi.
If you see the same behavior with stuff from Google (Gmail, Google Play app updates, etc.), then the problem lies with your phone or carrier. If the Google stuff works (they use what amounts to GCM), then your problem lies with Parse.com and whatever the other apps are using for push.
GCM (and the C2DM precursor) work over mobile data or WiFi. It is a bit tricky to implement a push system as a third-party library, which is why I recommend firmware solutions (GCM, Amazon's just-announced Kindle Fire equivalent, etc.). In particular, maintaining a mobile data connection to the push server, with enough heartbeats to keep the connection alive without really draining the battery, is difficult to get right, particularly given subtle mobile carrier or device variations. Google has more experience with this than do most firms, and Amazon only has to worry about a handful of Kindle Fire models.

Categories

Resources