react-native-actioncable icon indicating copy to clipboard operation
react-native-actioncable copied to clipboard

reconnect when app is in background

Open hcyildirim opened this issue 7 years ago • 2 comments

Hi,

Sometimes the socket connection disconnects when the application is in the background. How do I get it to reconnect when the application is opened?

Thank you.

hcyildirim avatar Sep 26 '18 08:09 hcyildirim

I think maybe you can try AppState to listen if App is foreground or not and try to reconnect when App back to action https://facebook.github.io/react-native/docs/appstate

gogojimmy avatar Nov 13 '18 08:11 gogojimmy

I thought that too. But how can I reconnect? I mean, i need something like ActionCable.reconnect() isn't it?

hcyildirim avatar Nov 13 '18 10:11 hcyildirim