im::floo::floolib::BMXUserService
User Service
Public Functions
Name | |
---|---|
synchronized void | delete() |
[BMXErrorCode] | bindDevice(String token) Binding device push token |
[BMXErrorCode] | getDeviceList(BMXDeviceList deviceList) Get device list |
[BMXErrorCode] | getProfile(BMXUserProfile profile, boolean forceRefresh) Get user details, force pull from server if forceRefresh == true |
[BMXErrorCode] | deleteDevice(int device_sn) Delete device |
[BMXErrorCode] | setNickname(String nickname) Set nickname |
[BMXErrorCode] | uploadAvatar(String avatarPath, FileProgressListener callback) Upload avatar |
[BMXErrorCode] | downloadAvatar(BMXUserProfile profile, boolean thumbnail, FileProgressListener callback) Download avatar, default to download thumbnail |
[BMXErrorCode] | setPublicInfo(String publicInfo) Set public extension information |
[BMXErrorCode] | setPrivateInfo(String privateInfo) Set private extension information |
[BMXErrorCode] | setAddFriendAuthMode(BMXUserProfile.AddFriendAuthMode mode) Set method to validate when adding friend |
[BMXErrorCode] | setAuthQuestion(BMXUserProfile.AuthQuestion authQuestion) Set friend authentication questions |
[BMXErrorCode] | setEnablePush(boolean enable) Set whether push is allowed |
[BMXErrorCode] | setEnablePushDetaile(boolean enable) Set whether to push details |
[BMXErrorCode] | setPushNickname(String nickname) Set push nickname |
[BMXErrorCode] | setPushAlias(String alias, String bmxPushToken) Set push alias |
[BMXErrorCode] | setNotificationSound(boolean enable) Set whether a new message is audibly alerted |
[BMXErrorCode] | setNotificationVibrate(boolean enable) Set whether a new message is alerted in vibration |
[BMXErrorCode] | setAutoDownloadAttachment(boolean enable) Set whether to automatically download thumbnail and voice attachment |
[BMXErrorCode] | setAutoAcceptGroupInvite(boolean enable) Set whether to automatically accept group invitations |
void | addUserListener(BMXUserServiceListener listener) Add user state listener |
void | removeUserListener(BMXUserServiceListener listener) Remove user state listener |
Protected Functions
Name | |
---|---|
BMXUserService(long cPtr, boolean cMemoryOwn) | |
void | finalize() |
long | getCPtr(BMXUserService obj) |
Protected Attributes
Name | |
---|---|
transient boolean | swigCMemOwn |
Public Functions Documentation
function delete
inline synchronized void delete()
Example:
function bindDevice
inline BMXErrorCode bindDevice(
String token
)
Binding device push token
Parameters:
- token Device token
Return: [BMXErrorCode]
Example:
function getDeviceList
inline BMXErrorCode getDeviceList(
BMXDeviceList deviceList
)
Get device list
Parameters:
- deviceList Device list, pass in an empty list function and fetch the returned device list here
Return: [BMXErrorCode]
Example:
function getProfile
inline BMXErrorCode getProfile(
BMXUserProfile profile,
boolean forceRefresh
)
Get user details, force pull from server if forceRefresh == true
Parameters:
- profile User profile, initially passed in a pointing-to-empty shared_ptr object, and fetch user profile here after the function returned.
- forceRefresh Whether to force pull from server, automatically if local fetch failed
Return: [BMXErrorCode]
Example:
public BMXUserProfile getProfileByDB() {
BMXUserProfile profile = new BMXUserProfile();
BMXErrorCode error = mUserService.getProfile(profile, false);
if (error == null || error.swigValue() != BMXErrorCode.NoError.swigValue()) {
return null;
}
return profile;
function deleteDevice
inline BMXErrorCode deleteDevice(
int device_sn
)
Delete device
Parameters:
- device_sn Device serial number
Return: [BMXErrorCode]
Example:
function setNickname
inline BMXErrorCode setNickname(
String nickname
)
Set nickname
Parameters:
- nickname User nickname
Return: [BMXErrorCode]
Example:
function uploadAvatar
inline BMXErrorCode uploadAvatar(
String avatarPath,
FileProgressListener callback
)
Upload avatar
Parameters:
- avatarPath Local address to upload avatar
- callback Upload callback function
Return: [BMXErrorCode]
Example:
function downloadAvatar
inline BMXErrorCode downloadAvatar(
BMXUserProfile profile,
boolean thumbnail,
FileProgressListener callback
)
Download avatar, default to download thumbnail
Parameters:
- profile User profile
- thumbnail Whether to download thumbnail, true for thumbnail, false for original
- callback Download callback function
Return: [BMXErrorCode]
Example:
function setPublicInfo
inline BMXErrorCode setPublicInfo(
String publicInfo
)
Set public extension information
Parameters:
- publicInfo Public extension information
Return: [BMXErrorCode]
Example:
function setPrivateInfo
inline BMXErrorCode setPrivateInfo(
String privateInfo
)
Set private extension information
Parameters:
- privateInfo Private extension information
Return: [BMXErrorCode]
Example:
function setAddFriendAuthMode
inline BMXErrorCode setAddFriendAuthMode(
BMXUserProfile.AddFriendAuthMode mode
)
Set method to validate when adding friend
Parameters:
- mode Add friend authentication
Return: [BMXErrorCode]
Example:
function setAuthQuestion
inline BMXErrorCode setAuthQuestion(
BMXUserProfile.AuthQuestion authQuestion
)
Set friend authentication questions
Parameters:
- authQuestion Add friend authentication question
Return: [BMXErrorCode]
Example:
function setEnablePush
inline BMXErrorCode setEnablePush(
boolean enable
)
Set whether push is allowed
Parameters:
- enable Whether to allow push, true to push, false not to
Return: [BMXErrorCode]
Example:
function setEnablePushDetaile
inline BMXErrorCode setEnablePushDetaile(
boolean enable
)
Set whether to push details
Parameters:
- enable Whether to push details, true to push, false not to
Return: [BMXErrorCode]
Example:
function setPushNickname
inline BMXErrorCode setPushNickname(
String nickname
)
Set push nickname
Parameters:
- nickname Push nickname
Return: [BMXErrorCode]
Example:
function setPushAlias
inline BMXErrorCode setPushAlias(
String alias,
String bmxPushToken
)
Set push alias
Parameters:
- alias Alias
- bmxPushToken Push token
Return: [BMXErrorCode]
Example:
function setNotificationSound
inline BMXErrorCode setNotificationSound(
boolean enable
)
Set whether a new message is audibly alerted
Parameters:
- enable Whether to sound alert when new message received, true to alert, false not to
Return: [BMXErrorCode]
Example:
function setNotificationVibrate
inline BMXErrorCode setNotificationVibrate(
boolean enable
)
Set whether a new message is alerted in vibration
Parameters:
- enable Whether to vibrate alert when new message received, true to alert, false not to
Return: [BMXErrorCode]
Example:
function setAutoDownloadAttachment
inline BMXErrorCode setAutoDownloadAttachment(
boolean enable
)
Set whether to automatically download thumbnail and voice attachment
Parameters:
- enable Whether to automatically download thumbnail and voice attachment, true to download, false not to
Return: [BMXErrorCode]
Example:
function setAutoAcceptGroupInvite
inline BMXErrorCode setAutoAcceptGroupInvite(
boolean enable
)
Set whether to automatically accept group invitations
Parameters:
- enable Whether to automatically agree to group invitation, true to agree, false not to
Return: [BMXErrorCode]
Example:
function addUserListener
inline void addUserListener(
BMXUserServiceListener listener
)
Add user state listener
Parameters:
- listener User state listener
Example:
function removeUserListener
inline void removeUserListener(
BMXUserServiceListener listener
)
Remove user state listener
Parameters:
- listener User state listener
Protected Functions Documentation
Example:
function BMXUserService
inline BMXUserService(
long cPtr,
boolean cMemoryOwn
)
Example:
function finalize
inline void finalize()
Example:
function getCPtr
static inline long getCPtr(
BMXUserService obj
)
Protected Attributes Documentation
variable swigCMemOwn
transient boolean swigCMemOwn;
Example:
Updated on 2022-01-26 at 17:18:31 +0800