Add an example for foreground service
Hi @dvmatyun ,
Could you add an example showing how to make the socket a foreground service and switch between service and normal implementation when app is in background/closed and when it is active?
hi @sagar1garg , as far as I know mobile OS (android & iOS) closes the socket connection itself when app is in the background, so you can not rely on stable connection when app is not active. For that purpose, I suggest you to use some scheduling triggers like local push notifications. If you have other information regarding background connection let me know. Later maybe I will add some functionality for "background synchronization" with server, but I doubt that it will be using webSocket connection (because Operating system just does not allow that). Let me know if you have any questions or maybe I got your idea wrong.