Skip to content
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

app goes to background working on simulator but not on device #54

Open
josefrm opened this issue Mar 20, 2015 · 3 comments
Open

app goes to background working on simulator but not on device #54

josefrm opened this issue Mar 20, 2015 · 3 comments

Comments

@josefrm
Copy link

josefrm commented Mar 20, 2015

Hello there,

I have an issue is when im testing the app in simulator, let me explain whats happening

When my app start´s I call a NSObject that handle my connection, and it's a shared object (static), so it handle all my connection thru all views.

Got a protocol to determinate when a message comes in then dispatch to the active view (subscribed one).

When I'm in simulator and minimize the App the application still connected to socket, and receive messages etc.. but when my app run into device it lost the connection (not showing message of disconnected) but simply cannot receive messages.

Any idea whats happening?

Thanks in advance.

@pblondin
Copy link

iOS will close your socket connection when the app is running in background mode. You should gracefully close the connection when it enters the background (via AppDelegate) and then reconnect the socket whe the app comes back into the foreground.

@josefrm
Copy link
Author

josefrm commented Mar 24, 2015

Yeah @pblondin, thats what happening in Device but not in Simulator, anyways I'm going to improve this with push notifications on server side., not what I want but have no choise.

Thanks for reply, regards.

@pblondin
Copy link

An hybrid solution with push notifications and socket.io communications is the way to go! Good luck on your project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants