-
Notifications
You must be signed in to change notification settings - Fork 373
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
iOS Error Socket is not connected when reopen app after a push notification #245
Comments
Hi @thierryfornetti , could you share a repo with your code? |
Hello @avishayil, unfortunately I can't share my code, when I have some time (and right now I don't) I'll try to create a little app that reproduce the error. index.ios.js
actions/websocket.js
Also, why it happens when I lock the screen and it doesn't when the app is just in background? |
@thierryfornetti Closing this issue due to inactivity. Apologies for the delayed response. I have seen this error with just react-native itself (not using web sockets in my own application). If you are still encountering this issue, please feel free to respond and I would be happy to reopen and investigate the problem. |
I'm running into this issue as well, anyone ever figured out what caused it? Here's what I do:
Thoughts? |
Hello, I’m making an App with React Native that use a chat and push notifications.
Only for ios, I keep getting an error 'The operation couldn’t be completed. Socket is not connected' when the app is reopened after I received a Push notification. I use websocket for the chat, I close it when the app goes in background and reopen it when the app gets active again (by using AppState), but appearently before the app became active there are some operations on the socket, and since it’s closed I get an error. This is the log from xCode when I open the app
I have no idea of what is logging those first lines. They seems operation on the socket that happen before I receive a notification of state "active". They're working on the socket that I closed when the app went in background, so of course I get a crash.
Anyway, the socket get recreated correctly, even if there is this error, when the app gets active it create a new socket and everything works fine.
This error happens only on certain conditions:
As you see it seems related to push notification and the screen locked.
After adding some logs inside the classes I got a more complete logs, but I still don’t know what are those logs
nw_socket_*
myChat ios logs - Crash on open notification.txt
What I’m using:
React Native 0.38
One Signal 3.0.3
Device iPhone5 iOS 10.1.1
xCode 8.3.1
Thanks for the help
The text was updated successfully, but these errors were encountered: