The userId* is a unique string of up to 64-characters that is used to identify a client (end user, device or server) that connects to PubNub. User IDs are also important for other features like Presence and Message Persistence to work as expected.
It is required to pass a userId when you instantiate a PubNub instance.*
A userId should be persisted for the lifetime of a user or a device that connects to PubNub. If you have enabled Presence for your key set, not setting a userId that is consistent for an end user may result in unexpected presence behavior. You can accomplish this by either passing the userId to the client upon successful login or by persisting the userId on the client where it can be retrieved the next time the PubNub instance is instantiated.
Please, refer to the following documentation for more information about userId configuration:
* Note: Older SDK versions referred to the userId as UUID, and did not require UUID provision on client instantiation, whereas our new SDKs require it.
In case of any questions, contact us at support@pubnub.com.