Package io.agora.rtm
Class RtmPresence
java.lang.Object
io.agora.rtm.RtmPresence
The RtmPresence class.
This class provides the rtm presence methods that can be invoked by your app.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidgetOnlineUsers(String channelName, RtmConstants.RtmChannelType channelType, GetOnlineUsersOptions options, ResultCallback<GetOnlineUsersResult> resultCallback) To query who joined this channelabstract voidgetState(String channelName, RtmConstants.RtmChannelType channelType, String userId, ResultCallback<UserState> resultCallback) Get user stateabstract voidgetUserChannels(String userId, ResultCallback<ArrayList<ChannelInfo>> resultCallback) To query which channels the user joined or subscribedabstract voidremoveState(String channelName, RtmConstants.RtmChannelType channelType, ArrayList<String> keys, ResultCallback<Void> resultCallback) Delete user stateabstract voidsetState(String channelName, RtmConstants.RtmChannelType channelType, Map<String, String> items, ResultCallback<Void> resultCallback) Set user stateabstract voidwhereNow(String userId, ResultCallback<ArrayList<ChannelInfo>> resultCallback) To query which channels the user joinedabstract voidwhoNow(String channelName, RtmConstants.RtmChannelType channelType, PresenceOptions options, ResultCallback<WhoNowResult> resultCallback) To query who joined this channel
-
Constructor Details
-
RtmPresence
public RtmPresence()
-
-
Method Details
-
whoNow
public abstract void whoNow(String channelName, RtmConstants.RtmChannelType channelType, PresenceOptions options, ResultCallback<WhoNowResult> resultCallback) To query who joined this channel- Parameters:
channelName- The name of the channel.channelType- The type of the channel.options- The query option.resultCallback- AResultCallbackobject. - Success: will receives theResultCallback.onSuccess(Object)callback. - Failure: will receives theResultCallback.onFailure(ErrorInfo)callback.
-
whereNow
To query which channels the user joined- Parameters:
userId- The id of the user.resultCallback- AResultCallbackobject. - Success: will receives theResultCallback.onSuccess(Object)callback. - Failure: will receives theResultCallback.onFailure(ErrorInfo)callback.
-
getOnlineUsers
public abstract void getOnlineUsers(String channelName, RtmConstants.RtmChannelType channelType, GetOnlineUsersOptions options, ResultCallback<GetOnlineUsersResult> resultCallback) To query who joined this channel- Parameters:
channelName- The name of the channel.channelType- The type of the channel.options- The query option.resultCallback- AResultCallbackobject. - Success: will receives theResultCallback.onSuccess(Object)callback. - Failure: will receives theResultCallback.onFailure(ErrorInfo)callback.
-
getUserChannels
public abstract void getUserChannels(String userId, ResultCallback<ArrayList<ChannelInfo>> resultCallback) To query which channels the user joined or subscribed- Parameters:
userId- The id of the user.resultCallback- AResultCallbackobject. - Success: will receives theResultCallback.onSuccess(Object)callback. - Failure: will receives theResultCallback.onFailure(ErrorInfo)callback.
-
setState
public abstract void setState(String channelName, RtmConstants.RtmChannelType channelType, Map<String, String> items, ResultCallback<Void> resultCallback) Set user state- Parameters:
channelName- The name of the channel.channelType- The type of the channel.items- The states item of user.resultCallback- AResultCallbackobject. - Success: will receives theResultCallback.onSuccess(Object)callback. - Failure: will receives theResultCallback.onFailure(ErrorInfo)callback.
-
removeState
public abstract void removeState(String channelName, RtmConstants.RtmChannelType channelType, ArrayList<String> keys, ResultCallback<Void> resultCallback) Delete user state- Parameters:
channelName- The name of the channel.channelType- The type of the channel.keys- The keys of state item.resultCallback- AResultCallbackobject. - Success: will receives theResultCallback.onSuccess(Object)callback. - Failure: will receives theResultCallback.onFailure(ErrorInfo)callback.
-
getState
public abstract void getState(String channelName, RtmConstants.RtmChannelType channelType, String userId, ResultCallback<UserState> resultCallback) Get user state- Parameters:
channelName- The name of the channel.channelType- The type of the channel.userId- The id of the user.resultCallback- AResultCallbackobject. - Success: will receives theResultCallback.onSuccess(Object)callback. - Failure: will receives theResultCallback.onFailure(ErrorInfo)callback.
-