I am implementing Sinch SDK in my Android application. I have observed one thing that after connecting sinch client if I turn off wifi(means now no internet connectivity is available) and I send 4 to 5 messages they are not sent (because on receiving side there are no messages received). As soon as, I turned my device wifi on and the android device gets connected sinch sends those pending messages.(because after connecting to the internet receiving side got those 5 messages which were sent earlier). My question is how does this happen. I mean does sinch maintain any internal queue system and for internet connectivity? Or there is something else is implemented?
Yes we do, we store it locally and sends it as soon as we can
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 read about why it is better to use GCM than having your android app poll continuously for updates from your application server. It is because the android app will only be notified to request an update from its application server when there is really an update - push notifications.
However, I don't see as to how this is possible. How will the server (GCM server) send data to the client (android app) without receiving any request from the client? This violates the client-server architecture that I know of. The only explanation that I can think of is, the GCM-enabled device is actually running its own server that listens to the GCM server. In this network map, the GCM now acts as both the client and the server.
So my question is, is my assumption right? If it is not, then what am I missing?
1.Android phone connect and keep socket connection to GCM server with a background service which managed by system.
2.Custom server (where you can run database, web service, background module) where will send require (command) to GCM server to push data (notify) to phone (client apps)
Summary: Android phone <-> GCM <-> Custom server (service)
How will the server (GCM server) send data to the client (android app) without receiving any request from the client?
It receives a request from the client. However, that "request" is for a long-lived socket connection, one that is carefully managed to stay up despite the CPU going into sleep mode. If the connection is dropped (e.g., connectivity issues), eventually the client will re-establish the connection.
However, given the open socket, the server can send packets down the socket to the client.
Google Cloud Message (GCM) only working when android device install "Google Play Service".
This service help android save resources (network bandwidth, battery, ...), how it work:
App 1 | | Server 1
App 2 |<--> GCM Service <-->| Server 2
App 3 | | Server 3
Instead of:
App 1 |<-->| Server 1
App 2 |<-->| Server 2
App 3 |<-->| Server 3
Your base server send message to Google Cloud and Google play service check message from Google Cloud and send it to you via an intent broashcast
I am working on an Android application which requires a server. One component of the application is used by people who do not have internet connection. But still I want to interact with the server. Is there anyway to send messages to server without internet connection? Can we send SMS to server and if yes how? I have read SMS gateway on the net but I failed to understand it.
There are no Android devices without internet connection, they need one at least to connect to Google Play to download your application.
You might have devices that have no connection for some time, then sending a SMS is theoretically possible but will cost money to the user so he is likely to disapprove this approach.
To receive the SMSs sent by devices, look for a "sms receive gateway", you will find companies that offer you an API to send and receive SMSs from your server. If you don't expect a huge traffic, you can have a phone at your home with a Wifi connection that receives the SMS and sends them back to you server.
Services like Twilio and Plivo will forward SMS messages to your server. However, I don't know of any free services for this (and I think Twilio may not be available in certain geographies).
This approach will allow phone users to communicate with your server using SMS (via one of these providers). While your phone user will not need to be connected to the internet (but they will need to have cell service that allows them to send an SMS), your server must be connected to the internet so that it can receive messages from the provider (Twilio or Plivo, for example).
I am trying to use GCM to try and send messages to my application even when the device is not connected to the internet. I know that GCM usually waits till the device has internet and then sends it the message. However, when I test it with my app by disabling WiFi, sending a push message and then enabling WiFi I do not see a message being received. I am following the exact example from this site. Since I am using an IntentService and BroadcastReceiver I figured it would handle the case. Do I have to make any other changes to make it work while the device has no internet? Since