a while ago I needed to implement a feature where user could get notification , even when app is closed and user had no GooglePlay services on his phone , well after sometime , I could implement this feature using workmanager and SignalR . But now I have another problem , one of my app users sent me a screenshot where my app used 30GB of his CelluarData and Wifi in background ,well that was alot , So I started searching and I was unable to find anything useful? is there any way I can do this?
Asked
Active
Viewed 39 times
0
-
There seem to be alternatives that don't require a play service. I don't know SignalR at all, maybe it is one of them. But it sounds to me like you are constantly polling for notifications, which is not ideal at all. See [here](https://stackoverflow.com/questions/21336808/is-it-possible-to-use-gcm-without-google-account-and-google-play-services-on-the) – lucidbrot Nov 08 '21 at 09:33
-
Well , SignalR will choose what is the best way to communicate with clients , long-polling , Web Socket, SSE are options and I don't have control over that , – Ami Bidar Nov 08 '21 at 09:36
-
How much and what kind of data is being sent over SignalR? If it is just small data, check the SignalR log/trace to see if there are constant reconnects and disconnects due to bad connection. You may need to add something on the client to retry connection more slowly with a larger delay in betweeen. – eglease Nov 08 '21 at 13:42
-
size of messages are small , not more than 50 characters per message , and I also added a 10 second delay for reconnecting to hub , so if there is a problem( which is unlikely) , there is always a delay for it – Ami Bidar Nov 09 '21 at 06:31
-
Run a SignalR trace to see if SignalR is sending a lot of reconnect messages. I don't really see how this could cause a 30 GB usage. Can you reproduce the issue? – eglease Nov 09 '21 at 15:11
-
I'm afraid I can't , only one user sent me this and I don't really know how that can happen – Ami Bidar Nov 10 '21 at 08:26