Package com.bitheads.braincloud.services
Class PresenceService
java.lang.Object
com.bitheads.braincloud.services.PresenceService
public class PresenceService extends Object
-
Constructor Summary
Constructors Constructor Description PresenceService(BrainCloudClient client) -
Method Summary
Modifier and Type Method Description voidforcePush(IServerCallback callback)Force an RTT presence update to all listeners of the caller.voidgetPresenceOfFriends(String platform, boolean includeOffline, IServerCallback callback)Gets the presence data for the given platform.voidgetPresenceOfGroup(String groupId, boolean includeOffline, IServerCallback callback)Gets the presence data for the given groupId.voidgetPresenceOfUsers(ArrayList<String> profileIds, boolean includeOffline, IServerCallback callback)Gets the presence data for the given profileIds.voidregisterListenersForFriends(String platform, boolean bidirectional, IServerCallback callback)Registers the caller for RTT presence updates from friends for the given platform.voidregisterListenersForGroup(String groupId, boolean bidirectional, IServerCallback callback)Registers the caller for RTT presence updates from the members of the given groupId.voidregisterListenersForProfiles(ArrayList<String> profileIds, boolean bidirectional, IServerCallback callback)Registers the caller for RTT presence updates for the given profileIds.voidsetVisibility(boolean visible, IServerCallback callback)Update the presence data visible field for the caller.voidstopListening(IServerCallback callback)Stops the caller from receiving RTT presence updates.voidupdateActivity(String activity, IServerCallback callback)Update the presence data activity field for the caller.
-
Constructor Details
-
PresenceService
-
-
Method Details
-
forcePush
Force an RTT presence update to all listeners of the caller. Service Name - Presence Service Operation - ForcePush- Parameters:
callback- The method to be invoked when the server response is received
-
getPresenceOfFriends
public void getPresenceOfFriends(String platform, boolean includeOffline, IServerCallback callback)Gets the presence data for the given platform. Can be one of "all", "brainCloud", or "facebook". Will not include offline profiles unless includeOffline is set to true.- Parameters:
platform- Gets a list of Presence entries for the specified platform or "all" for all platforms.includeOffline- Should offline users be included in the response?callback- The callback handler
-
getPresenceOfGroup
Gets the presence data for the given groupId. Will not include offline profiles unless includeOffline is set to true.- Parameters:
groupId- Gets a list of Presence for the members of the specified group. The caller must be a member of the given group.includeOffline- Should offline users be included in the response?callback- The callback handler
-
getPresenceOfUsers
public void getPresenceOfUsers(ArrayList<String> profileIds, boolean includeOffline, IServerCallback callback)Gets the presence data for the given profileIds. Will not include offline profiles unless includeOffline is set to true.- Parameters:
profileIds- Gets a list of Presence for the specified profile ids.includeOffline- Should offline users be included in the response?callback- The callback handler
-
registerListenersForFriends
public void registerListenersForFriends(String platform, boolean bidirectional, IServerCallback callback)Registers the caller for RTT presence updates from friends for the given platform. Can be one of "all", "brainCloud", or "facebook". If bidirectional is set to true, then also registers the targeted users for presence updates from the caller.- Parameters:
platform- Presence for friends of the caller on the specified platform. Use "all" or omit for all platforms.bidirectional- Should those profiles be mutually registered to listen to the current profile?callback- The callback handler
-
registerListenersForGroup
public void registerListenersForGroup(String groupId, boolean bidirectional, IServerCallback callback)Registers the caller for RTT presence updates from the members of the given groupId. Caller must be a member of said group. If bidirectional is set to true, then also registers the targeted users for presence updates from the caller.- Parameters:
groupId- Target group ID.bidirectional- Should those profiles be mutually registered to listen to the current profile?callback- The callback handler
-
registerListenersForProfiles
public void registerListenersForProfiles(ArrayList<String> profileIds, boolean bidirectional, IServerCallback callback)Registers the caller for RTT presence updates for the given profileIds. If bidirectional is set to true, then also registers the targeted users for presence updates from the caller.- Parameters:
profileIds- Array of target profile IDs.bidirectional- Should those profiles be mutually registered to listen to the current profile?callback- The callback handler
-
setVisibility
Update the presence data visible field for the caller.- Parameters:
visible- Should user appear in presence? True by default.callback- The callback handler
-
stopListening
Stops the caller from receiving RTT presence updates. Does not affect the broadcasting of *their* presence updates to other listeners.- Parameters:
callback- The callback handler
-
updateActivity
Update the presence data activity field for the caller.- Parameters:
activity- Presence activity record json. Size of the given activity must be equal to or less than the Max content size (bytes) app setting (see Messaging/Presence in the portal).callback- The callback handler
-