floo::BMXUserService

User Service

#include <bmx_user_service.h>

Public Types

Name
typedef std::function< void(int percent)> Callback

Public Functions

Name
virtual ~BMXUserService()
virtual BMXErrorCode bindDevice(const std::string & token) =0
Binding device push token
virtual BMXErrorCode getDeviceList(BMXDeviceList & deviceList) =0
Get device list
virtual BMXErrorCode deleteDevice(int32_t device_sn) =0
Delete device
virtual BMXErrorCode getProfile(BMXUserProfilePtr & profile, bool forceRefresh) =0
Get user details, force pull from server if forceRefresh == true
virtual BMXErrorCode setNickname(const std::string & nickname) =0
Set nickname
virtual BMXErrorCode uploadAvatar(const std::string & avatarPath, Callback callback) =0
Upload avatar
virtual BMXErrorCode downloadAvatar(BMXUserProfilePtr profile, bool thumbnail, Callback callback) =0
Download avatar, default to download thumbnail
virtual BMXErrorCode setPublicInfo(const std::string & publicInfo) =0
Set public extension information
virtual BMXErrorCode setPrivateInfo(const std::string & privateInfo) =0
Set private extension information
virtual BMXErrorCode setAddFriendAuthMode(BMXUserProfile::AddFriendAuthMode mode) =0
Set method to validate when adding friend
virtual BMXErrorCode setAuthQuestion(const [BMXUserProfile::AuthQuestion] & authQuestion) =0
Set friend authentication questions
virtual BMXErrorCode setEnablePush(bool enable) =0
Set whether push is allowed
virtual BMXErrorCode setEnablePushDetaile(bool enable) =0
Set whether to push details
virtual BMXErrorCode setPushNickname(const std::string & nickname) =0
Set push nickname
virtual BMXErrorCode setPushAlias(const std::string & alias, const std::string & bmxPushToken) =0
virtual BMXErrorCode setNotificationSound(bool enable) =0
Set whether a new message is audibly alerted
virtual BMXErrorCode setNotificationVibrate(bool enable) =0
Set whether a new message is alerted in vibration
virtual BMXErrorCode setAutoDownloadAttachment(bool enable) =0
Set whether to automatically download thumbnail and voice attachment
virtual BMXErrorCode setAutoAcceptGroupInvite(bool enable) =0
Set whether to automatically accept group invitations
virtual void addUserListener(BMXUserServiceListener * listener) =0
Add user state listener
virtual void removeUserListener(BMXUserServiceListener * listener) =0
Remove user state listener

Protected Functions

Name
BMXUserService()

Public Types Documentation

typedef Callback

typedef std::function<void(int percent)> floo::BMXUserService::Callback;

Public Functions Documentation

function ~BMXUserService

inline virtual ~BMXUserService()

Example:

function bindDevice

virtual BMXErrorCode bindDevice(
    const std::string & token
) =0

Binding device push token

Parameters:

  • token Device token

Return: BMXErrorCode

Example:

function getDeviceList

virtual BMXErrorCode getDeviceList(
    BMXDeviceList & deviceList
) =0

Get device list

Parameters:

  • deviceList Device list, pass in an empty list function and fetch the returned device list here

Return: BMXErrorCode

Example:

function deleteDevice

virtual BMXErrorCode deleteDevice(
    int32_t device_sn
) =0

Delete device

Parameters:

  • device_sn Device serial number

Return: BMXErrorCode

Example:

function getProfile

virtual BMXErrorCode getProfile(
    BMXUserProfilePtr & profile,
    bool forceRefresh
) =0

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:

BMXErrorCode errorCode = client->getUserService().getProfile(profile, false);

function setNickname

virtual BMXErrorCode setNickname(
    const std::string & nickname
) =0

Set nickname

Parameters:

  • nickname User nickname

Return: BMXErrorCode

Example:

BMXErrorCode errorCode = client->getUserService().setNickname(params[0]);

function uploadAvatar

virtual BMXErrorCode uploadAvatar(
    const std::string & avatarPath,
    Callback callback
) =0

Upload avatar

Parameters:

  • avatarPath Local address to upload avatar
  • callback Upload callback function

Return: BMXErrorCode

Example:

function downloadAvatar

virtual BMXErrorCode downloadAvatar(
    BMXUserProfilePtr profile,
    bool thumbnail,
    Callback callback
) =0

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

virtual BMXErrorCode setPublicInfo(
    const std::string & publicInfo
) =0

Set public extension information

Parameters:

  • publicInfo Public extension information

Return: BMXErrorCode

Example:

function setPrivateInfo

virtual BMXErrorCode setPrivateInfo(
    const std::string & privateInfo
) =0

Set private extension information

Parameters:

  • privateInfo Private extension information

Return: BMXErrorCode

Example:

function setAddFriendAuthMode

virtual BMXErrorCode setAddFriendAuthMode(
    BMXUserProfile::AddFriendAuthMode mode
) =0

Set method to validate when adding friend

Parameters:

  • mode Add friend authentication

Return: BMXErrorCode

Example:

function setAuthQuestion

virtual BMXErrorCode setAuthQuestion(
    const BMXUserProfile::AuthQuestion & authQuestion
) =0

Set friend authentication questions

Parameters:

  • authQuestion Add friend authentication question

Return: BMXErrorCode

Example:

function setEnablePush

virtual BMXErrorCode setEnablePush(
    bool enable
) =0

Set whether push is allowed

Parameters:

  • enable Whether to allow push, true to push, false not to

Return: BMXErrorCode

Example:

function setEnablePushDetaile

virtual BMXErrorCode setEnablePushDetaile(
    bool enable
) =0

Set whether to push details

Parameters:

  • enable Whether to push details, true to push, false not to

Return: BMXErrorCode

Example:

function setPushNickname

virtual BMXErrorCode setPushNickname(
    const std::string & nickname
) =0

Set push nickname

Parameters:

  • nickname Push nickname

Return: BMXErrorCode

Example:

function setPushAlias

virtual BMXErrorCode setPushAlias(
    const std::string & alias,
    const std::string & bmxPushToken
) =0

Parameters:

  • nickname Push nickname

Return: BMXErrorCode

Example:

function setNotificationSound

virtual BMXErrorCode setNotificationSound(
    bool enable
) =0

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

virtual BMXErrorCode setNotificationVibrate(
    bool enable
) =0

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

virtual BMXErrorCode setAutoDownloadAttachment(
    bool enable
) =0

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

virtual BMXErrorCode setAutoAcceptGroupInvite(
    bool enable
) =0

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

virtual void addUserListener(
    BMXUserServiceListener * listener
) =0

Add user state listener

Parameters:

  • listener User state listener

Example:

client->getUserService().addUserListener(userListener);

function removeUserListener

virtual void removeUserListener(
    BMXUserServiceListener * listener
) =0

Remove user state listener

Parameters:

  • listener User state listener

Protected Functions Documentation

Example:

mService->removeUserListener(this);
client->getUserService().removeUserListener(userListener);

function BMXUserService

inline BMXUserService()

Example:


Updated on 2022-01-26 at 17:20:40 +0800

© 2019-2023 MaximTop | Homepage Last modified time: 2023-08-09 14:48:15

results matching ""

    No results matching ""