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

Using Presence? Got a "high occupancy" channel? Then mind your Presence Announce Max property

There is a not so well-known Presence property in your account portal named Presence Announce Max and the default value is 20. When a client subscribes to a channel, join events are sent out on that channel's presence channel. And when they unsubscribe, a leave event is sent (or a timeout if there wasn't an explicit unsubscribe).

But once the occupancy on a channel reaches the Presence Announce Max threshold, these leave, join and timeout events are no longer sent by PubNub. Instead, an occupancy count update is sent every 10 seconds (configured by the Presence Interval property) on the presence channel.

So if you want join/leave/timeout events to continue to be fired, you have to set this property to a number that suits your use case. The limit is 100, which should be plenty for most use cases. But if you want to set it even higher, you can send an email to support@pubnub.com to request that is be set for you. But be forewarned that every presence event is sent to every subscriber that has implemented the presence callback, so this can get very noisy.

NOTE: No matter what this property's value is or what the occupancy of the channel happens to be, state-change events will always be sent when a user's state is modified (setState in Java, for example).

Hi craig

I have problem regarding presence API in my android chat app. The day before yesterday it was working fine but since today morning the presence api not working. Is there any restriction with presence api? Please help regarding this issue

Tajinder, please open a case with support (email support@pubnub.com) with details about what is "not working", which SDK/version you are using and your sub-key.

Corrected the presence announce max from 10,000 to 100. This limit was recently reduced because use cases above 100 concurrent subscribers (where you need to receive all join/leave/timeout events) are something we want to double check to make sure you are using best practices (more than one way to skin an app).

Helllo Graig, Thank you for the post, I was just wondering how our application would scale up once we will launch. In our app, connected users have a "friend list" (each with their own uuid) to be able to private chat once connection is detected. We are planning in streaming live concert and we hopefully will have 5K o more users connected during the event. If the limit is 100 join/leave/timeout, how can we then detect when a user just connected and set its status to "connected" in the client friend's list? Thank you, Sébastien

Hello Craig, Can this Presence Announce Max property be set at channel level rather than Account? This seems pretty handy if you want to monitor a large base of users. I would just set it to 1 for a dedicated channel as I would not be interested as who is joining or leaving. Just getting a count of users ...

This is a sub-key setting so it affects all channels globally under that particular sub-key.


Comments to this discussion are now closed!