I'm new on sending push notifications on android. I try to send push notification for my testing application periodically. But sometimes device can't receive the notification. I searched about it and i think the problem is because of connection lost between server and my device. I think the solution is sending an heartbeat network packet on the push connection but i don't know how can i do it and to which server i should do it?
There is an application on google play store called as Push Notifications Fixer and i think this work is what i want to do
Related
I was wondering how the actual request from Server get routed to the Application if the browser is not running. Also, does the service workers maintain an active connection to the server so that it receives the push notification whenever the server publishes something?
I think for every iOS device, Apple keeps a socket open between that device and the Apple Push Notification Service. Which essentially acts as a router for all notifications across all apps and all devices. So your server can send messages to APNS saying "yo, hit up this guy with this message", and APNS will use the socket it has open with every device to send the notification.
Also check out https://developer.apple.com/notifications/.
And https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server
connect my Android device to WIFI AP.
remove WLAN cable from AP, and connect it again.
Trying send a GCM message to my device, but message's not arrived.
after 15-30 min, GCM message's arrived.
I think GCM service is trying to send a refresh message to server in 15-30 min every time. so during this time, GCM service on broken network, cannot recv any GCM message from server until connection has been restored.
and I've tested this issue on FCM, but result's same.
on iOS (I mean APNS), it's working fine at same situation.
Is there any good solution to make this delay to sort on Android device?
This is because of Heartbeat issue with server you can forcefully send the heartbeat where you want
context.sendBroadcast(new Intent("com.google.android.intent.action.GTALK_HEARTBEAT"));
context.sendBroadcast(new Intent("com.google.android.intent.action.MCS_HEARTBEAT"));
OR
There's no need to send the heartbeat from the GCM server to the phone, you can force android itself to send the heartbeat sooner that it would otherwise do.
I had a look at the Push Notifications Fixer app, which I tested and worked for me, and it seems all you need to do is broadcast the following intents:
com.google.android.intent.action.MCS_HEARTBEAT
com.google.android.intent.action.GTALK_HEARTBEAT
I have a web socket that I need to receive information from in my android app. Would keeping a single web socket open at all times drain the battery on my android device? I expect that this web socket will only send notifications once every 24-hours, which is why I would like to close the connection, and somehow convert the web socket into a push notification. But, then I also need to be able to send from the android app to subscribe to the web socket and receive push notifications. How can I go about doing this?
I recommend using push notifications, which consume less battery of your phone and even more if you only send data once every 24 hours.
What technologies you plan to use?
In my android application , i use push notification .I had one if there is no network connection in my android device means .Then push notification works or not in my android device
If the target device is not connected to the internet, then the GCM adds the Notifications to a pipeline to be delivered at a later stage. There are limitation on the pipeline size and the maximum time of un-connectivity, after which GCM aborts the pending GCM messages. But for a general case, this should do the needful.
You need Internet Connection.
GCM clients receive notifications through a socket, which is handled by Google Services to the Internet
Without Internet you will not receive any notification from GCM. Till your connection is not there GCM fill store all notification for you and as soon as you got connected it will release its burrer
I have implemented chat in my project and using GCM for it.In this i have came across the strange issue.
I have do following steps for it.
Send chat message to server.
Server fetches reg key of device and send push message to GCM server.
Now on other device in which i am receiving push message i tried waiting for the push message for a long time.
But i did not receive the push message.
Now when i turn my wifi off and on it again or switch from 3g to wifi or vice-versa, i get all push messages at once.
I have read GCM docs and i also have seen these two questions in Stackoverflow.
Google Cloud Messaging - messages sometimes not received until network state changed
Device stops receiving GCM pushes until network is switched
I have also referred a google groups question regarding this issue
Problem in getting messages on device using GCM.
But i didn't get any solution till now.
I am using Asp.net at the server side.
Any help or suggestion is appreciated.