When I send a data only message from the app server while the app is killed or device turned off, the message is never received in the app after it is restarted. The send action (REST HTTP) is successful. When I only turn off the internet on the phone, then send a message from the server, now turn on the internet on phone, the message is received. But after app killed or device turned off, the message is never received after app runs again.
{
"to" : "thekey",
"data" : {
"id" : "123"
}
}
Or can I force a sync from the FCM server when my app starts?
I am using FCM 11.0.4.
Any help would be appreciated.
This could be a device specific issue. Many OEMs lauchers force stop the application once killed. Example Oppo, xiaomi, etc
The GCM/FCM server delivers the push payload to the device but the play services running on the device is not able to deliver the message to the application as the app is force stopped.
So according the GCM/FCM server the notification is delivered to the app but in reality the notification payload is only delivered to the play services instance on the device.
Try on a stock android device like Nexus or Pixel you shouldn't face this issue.
FYI: Once the app is force stopped no receiver or alarm for the app will be active till the app is opened again by explicit user action
Related
I learned that PUSH NOTIFICATION service is like a persistent TCP connection.
But I don't know how maintain the connection even if the phone terminate the app.
In mobile application, if the subscription is destroyed, how we publish and deliver the message?
Should I use GCM, APNS or SMS? And wait until client subscribe the topic?
That's correct, you have to be connected with the broker (mosquitto broker in this case) to receive the push notification (you also must be subscribed to topic).
In Android I'm using paho client libray, a Service for keep connection in background, and BroadcastReceiver to start service at reboot.
For iOS you can find swift and Objetive-C MQTT-client librarys (I'm using CocoaMQTT) but you can't keep connection in background indefinitely. You have to use APNS.
I have developed a Mobile App using Xamarin Studio(C#).I used SignalR to receive push notification from the server.But its wired if start to implement reconnect & time out.
Reconnect:
NOTE:I did testing by turn off/on to my network connection.
It works well after the first disconnect(i.e;i am able to reconnect after the first disconnect from network .But again if I try to reconnect, I am not able to get any notifications from server.
I got like :Transport Timeout....Disconnection timeout...
Some sample code is really appreciated.
TimeOut:
I am able to get push notifications till 15minutes from the server,but after that the server got timed out. How to increase the timeout or how to handle timeout,will the below helps to increase timeout for the push notification?
_hubConnection.TransportConnectTimeout = TimeSpan.FromMinutes (60);?
Some sample code is really appreciated.
Hmm..Got a solution to implement reconnecting logic :) .. in Xamarin.mac project.No timer nothing needed.Just an network check required before run the push notification logic.thats it :) ..
I am closing this post :)
I'm writing Windows Phone 8.1 application and I want to receive the push notifications from the SinglaR server. It is working, but only when the application is on the foreground.
How can I receive the notification when the application is in the background or shut down?
Does PushNotificationTrigger catches the notification from the SignalR? Or does the PushNotificationTrigger work only with WNS?
Thank you
SignalR offers realtime connection and data exchange while the application is active and connected. Once application goes to background it is effectively closed and all active connections are closed.
If you want to send push notifications, that is something OS offers and is not something you do via your own framework. If you want to receive notifications while the application is closed, you need to use the standard push functionality built into the platform. And which is completely separated from SignalR.
You can still use your website to send push notifications though.
I'm testing my Android app in dev environment with UrbanAirship as push notifications provider. Sometimes after sending several pushes (let's say I receive 3 or 4), they just stop arriving I don't know what happens with the other pushes I sent (5 or 6 more).
I send all pushes via console, not using Urban Airship web forms for testing pushes.
I've tried closing the app and reopening it and nothing happens. Just when I restart my device then all the pending messages arrive at once.
Could you please tell me how to avoid this?
What are push notifications and how do they work? Also what is the difference with googles cloud to device messaging? Is c2dm also a push notification? Also do I need Special server setup to implement push notification?are push standard or every device has different implementation?
Basically the server maintains a list of connected clients. Whenever something of interest occurs, the server sends the data/notification/updated state to the connected clients. This is in contrast with pull, where the clients poll the server for changes.