HeimgardTechnologiesAS / cordova-plugin-advanced-websocket

MIT License
27 stars 18 forks source link

Can websocket run on a separate background service? #11

Closed lovelyelfpop closed 4 years ago

Mapiac commented 5 years ago

Anyone???

chax commented 5 years ago

I don't understand the question. Are you asking if it can be used in a Singleton object that is shared between multiple pages of your app and always running in background? If that is the question, the answer is definitely yes, because that is exactly how we use it in our app. We use it to open permanent ws connection as long as the app is opened and we close the ws whenever app goes to background.

Mapiac commented 5 years ago

Thanks @chax we use it the same actually. My intention may have no aligned with the original posters question, but anyways it was specific to the PING PONG and at times having what I suspected was the websockets stay alive blocking the UI touch scrolls based on the single threaded nature of JS.

chax commented 5 years ago

Whole websocket code is ran natively. In Java for Android and in ObjectiveC for iOS. It's not blocking anything on UI because of that.

chax commented 4 years ago

Closing this as question is kind of vague and i responded best i can but there were no further responses from OP.