You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Everything is working, except for one thing.
Keeping the connection open when the app is on the background (the user is at the home screen)
I want to keep it open, so I can send a notification or something else to it.
Do you have the same problem ?
Or can you send messages to it, when the app is in the background ?
The text was updated successfully, but these errors were encountered:
I've implemented support in Primus-Objc for background connectivity successfully. This is already handled for you but, in your case, you'll have to implement it yourself since you're using a WebSocket library directly.
You will need to enable VOIP for background usage in our app's plist. You can then hand off your TCP connection to the system by implementing the -stream:handleEvent: method.
The trick is that iOS only gives you CPU time every 10 minutes or so (that's the minimum you can ask from the OS). When that happens, you need to the send a heartbeat to the primus server so that it doesn't kill your connection.
For this to work, you will also need to configure your primus server with a 10-minute timeout, as described here.
I'm testing swift at the moment, and therefore I can't use your code :(
(or maybe I can, but don't know how haha)
That's why i'm using https://github.com/daltoniam/Starscream/blob/master/examples/SimpleTest/SimpleTest/ViewController.swift
and a nodejs primus server with faye.
Everything is working, except for one thing.
Keeping the connection open when the app is on the background (the user is at the home screen)
I want to keep it open, so I can send a notification or something else to it.
Do you have the same problem ?
Or can you send messages to it, when the app is in the background ?
The text was updated successfully, but these errors were encountered: