Modifier and Type | Method and Description |
---|---|
static void |
addAuthIdentity(AuthIdentity authIdentity,
AddAuthIdentityCallback callback)
Adds AuthIdentity for the specified provider.
|
static void |
addFriend(String userId,
Callback<Integer> callback)
Add a friend for current user, if operation succeed - they both became friends.
|
static Map<String,String> |
getAllPrivateProperties()
Get all private properties of current user.
|
static Map<String,String> |
getAllPublicProperties()
Get all public properties of current user.
|
static Map<String,String> |
getAuthIdentities()
Returns all auth identities added to the user.
|
static String |
getAvatarUrl() |
static String |
getDisplayName() |
static void |
getFriends(int offset,
int limit,
Callback<List<PublicUser>> callback)
Get a list of friends for current user.
|
static void |
getFriendsCount(Callback<Integer> callback)
Get count of friends.
|
static String |
getId()
Returns id of the user.
|
static String |
getPrivateProperty(String key)
Returns the value of a private property on the current user with the specified key.
|
static String |
getPublicProperty(String key)
Returns the value of a public property on the current user with the specified key.
|
static void |
getSuggestedFriends(int offset,
int limit,
Callback<List<im.getsocial.sdk.socialgraph.SuggestedFriend>> callback)
Get a list of suggested friends for current user.
|
static boolean |
hasPrivateProperty(String key)
Checks if private property exists for the specified key.
|
static boolean |
hasPublicProperty(String key)
Checks if public property exists for the specified key.
|
static boolean |
isAnonymous()
Indicates if the user has at least one auth identity available.
|
static void |
isFriend(String userId,
Callback<Boolean> callback)
Check if user is your friend.
|
static void |
removeAuthIdentity(String providerId,
CompletionCallback callback)
Removes AuthIdentity for the specified provider.
|
static void |
removeFriend(String userId,
Callback<Integer> callback)
Remove a user from friends list.
|
static boolean |
removeOnUserChangedListener()
Remove current listener.
|
static void |
removePrivateProperty(String key,
CompletionCallback callback)
Removes one of the private properties of the authenticated user.
|
static void |
removePublicProperty(String key,
CompletionCallback callback)
Removes one of the public properties of the authenticated user.
|
static void |
setAvatarUrl(String avatarUrl,
CompletionCallback callback)
Requests setting a new avatar url for the current user.
|
static void |
setDisplayName(String displayName,
CompletionCallback callback)
Requests setting a new display name for the current user.
|
static boolean |
setOnUserChangedListener(OnUserChangedListener listener)
Set listener to be notified when the user was changed.
|
static void |
setPrivateProperty(String key,
String value,
CompletionCallback callback)
Set the private property with specified key and value for the authenticated user.
|
static void |
setPublicProperty(String key,
String value,
CompletionCallback callback)
Set the public property with specified key and value for the authenticated user.
|
static void |
setUserDetails(UserUpdate userUpdate,
CompletionCallback callback)
Requests a bulk change of properties for the current user.
|
static void |
switchUser(AuthIdentity authIdentity,
CompletionCallback callback)
Switches the current user with the PublicUser corresponding to the details provided.
|
public static boolean setOnUserChangedListener(OnUserChangedListener listener)
OnUserChangedListener.onUserChanged()
method.
Listener will be invoked when:
- SDK initialization is finished;
- switchUser(im.getsocial.sdk.usermanagement.AuthIdentity, im.getsocial.sdk.CompletionCallback)
method was called and user was successfully changed.listener
- Listener to be notified.public static boolean removeOnUserChangedListener()
public static void setUserDetails(UserUpdate userUpdate, CompletionCallback callback)
userUpdate
- Update parameter.callback
- A callback to indicate if this operation was successful.public static void setPublicProperty(String key, String value, CompletionCallback callback)
key
- The property key (Maximum length 64 characters).value
- The property value (Maximum length 1024 characters).callback
- A callback to indicate if this operation was successful.public static void setPrivateProperty(String key, String value, CompletionCallback callback)
key
- The property key (Maximum length 64 characters).value
- The property value (Maximum length 1024 characters).callback
- A callback to indicate if this operation was successful.public static void removePublicProperty(String key, CompletionCallback callback)
key
- The property key (Maximum length 64 characters).callback
- A callback to indicate if this operation was successful.public static void removePrivateProperty(String key, CompletionCallback callback)
key
- The property key (Maximum length 64 characters).callback
- A callback to indicate if this operation was successful.@Nullable public static String getPublicProperty(String key)
key
- The property key.@Nullable public static String getPrivateProperty(String key)
key
- The property key.public static boolean hasPublicProperty(String key)
key
- Property key.public static boolean hasPrivateProperty(String key)
key
- Property key.public static Map<String,String> getAllPublicProperties()
setPublicProperty(String, String, CompletionCallback)
and removePublicProperty(String, CompletionCallback)
.public static Map<String,String> getAllPrivateProperties()
setPrivateProperty(String, String, CompletionCallback)
and removePrivateProperty(String, CompletionCallback)
.@Nullable public static String getId()
public static void setDisplayName(String displayName, CompletionCallback callback)
displayName
- The proposed new displayName (Maximum length 32 characters).callback
- A callback to indicate if this operation was successful.@Nullable public static String getDisplayName()
public static void setAvatarUrl(String avatarUrl, CompletionCallback callback)
avatarUrl
- The proposed new avatarUrl (Maximum length 2048 characters).callback
- A callback to indicate if this operation was successful.@Nullable public static String getAvatarUrl()
public static boolean isAnonymous()
public static void addAuthIdentity(AuthIdentity authIdentity, AddAuthIdentityCallback callback)
authIdentity
- AuthIdentity to be added.callback
- A callback to indicate if this operation was
successful or if there was a conflict.public static void switchUser(AuthIdentity authIdentity, CompletionCallback callback)
authIdentity
- AuthIdentity to be switched to.callback
- A callback to indicate if this operation was successful.public static void removeAuthIdentity(String providerId, CompletionCallback callback)
providerId
- The provider connected to an auth identity on the current user to remove.
Valid providerIds are found in AuthIdentityProviderIds
in addition to custom providers.callback
- A callback to indicate if this operation was successful.public static Map<String,String> getAuthIdentities()
public static void addFriend(String userId, Callback<Integer> callback)
Callback.onSuccess(Object)
will be called,
but user will be added to your friends list only once and your friends count won't be increased.userId
- Unique user identifier you want to become friend with.callback
- A callback to indicate if this operation was successful.public static void removeFriend(String userId, Callback<Integer> callback)
Callback.onSuccess(Object)
will be called,
and your friends count won't be decreased.userId
- Unique user identifier you don't want to be friends anymore.callback
- A callback to indicate if this operation was successful.public static void isFriend(String userId, Callback<Boolean> callback)
userId
- Unique user identifier.callback
- Called with true, if user is your friend, false otherwisepublic static void getFriendsCount(Callback<Integer> callback)
callback
- Called with count of friends.public static void getFriends(int offset, int limit, Callback<List<PublicUser>> callback)
offset
- Position from which start.limit
- Limit of users.callback
- Called with list of users that are friends of current user.public static void getSuggestedFriends(int offset, int limit, Callback<List<im.getsocial.sdk.socialgraph.SuggestedFriend>> callback)
offset
- Position from which start.limit
- Limit of users.callback
- Called with list of users that are friends of current user.(c) Copyright GetSocial BV, 2017. All Rights Reserved.