Signal Reconnect & TimeOut - signalr

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

Related

Firebase pending messages not received after app is killed and restarted

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

Spring websocket working on local tomcat but not in server

I have a Spring mvc application, and I'm using websockets to communicate a phisical device that sends data with an angular 2 front end.
the architecture is like this
device ----> Spring Mvc <-----angular 2 front end
I have a datasource listener that publish to a websocket topic everytime a new message appears and I consume that topic from angular.
My problem is that this is working properly in my local tomcat install but when I upload it to a faster server it doesn't.
The main problem I'm having is that is buffering the messages and is reaching the limit and closing the websocket session.
What I noticed checking the logs is that in my local server messages come 20 milliseconds after last one is finished but in the other server sometimes are coming at the same time and they are being buffered throwing the session limit exception.
I tried setting a higher buffer size.
Also tried a thread.sleep but it doesn't worked.
Do you have some ideas what can I do ? should I implement some kind of message queue ?
Thanks in advance

How to build push notification in mobile application using mosquitto?

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.

Push notifications delay with GCM

We have an app (Ruby on Rails) that sends push notifications to an android app and we're facing an issue with GCM where some of these notifications are either delayed or never received. Considering the fact that these notifications are being sent to employees and not end-users my questions is:
What the best way to send these push notifications without any delay or drop and is there a way to send push notifications independently from the available services such as GCM and SNS?
Please keep in mind that we're looking for a solutions that can send these notifications without any delay as for the app to perform well the notification must be received within 1 to 20 seconds from the time it was sent.
Thanks in advance for anyone that will reply to this question...
Have a look at "Pushy":
They state the following on their website:
The most reliable push notification gateway, perfect for real-time
applications.
Google Cloud Messaging simply doesn't cut it for time-sensitive,
real-time apps, due to its instability and push notification
throttling.
Pushy works by maintaining a dedicated background socket connection
using the MQTT protocol, an extremely light-weight pub/sub protocol
that consumes very little network bandwidth and battery, which makes
it perfect for mobile.
You can use it for free with up to 100 devices, so you could just give it a try to see, if it fits your needs. I didn't try it.

Meteor.status() not change on disconnect

Meteor.status().status report "connected", also if I disconnect PC (ethX down)
It work only if I close meteor server.
How can I notify if client is connected (or not) to the server?
thanks in advance!
It takes a while for it to notice, keep in mind the web browser isn't aware of your hardware activities (ethernet disconnected, sudden loss of internet, etc). There are a couple of new APIs out there with HTML5 but meteor doesn't yet use these & they don't work under all browsers.
The only way to tell is to try to connect and watch for errors/failures to connect.
As soon as a heartbeat is missed (not sure what the interval is), or you run a .call,.insert, etc and there isn't a reply from the server then the status will change to disconnected.

Resources