The community forums are in BETA and closed to the public.

How to manage presence in background iOS .?

I have created a chat application. For that i have enable presence for a single channel and all user subscribe that channel. But when i close the app (Background Mode) pubnub gives me Timeout statement for that user.

But i want to show user Online until user terminate the app.

How we will manage this scenario ?

Please guide.

You could use Background App Refresh and make a presence heartbeat request.

Here's a simple explanation for Background App Refresh(

Feel free to google around for more results

You're limited to about 30 seconds to do all your work (should be enough time if you have a valid connection). You can also control the interval of the background fetch. Looks like you'll have to implement some of this yourself, but it should be doable on iOS 7 and iOS 8.

Login or Signup to post a comment