LANYINGDevelopers
Web & Mini ProgramiOSAndroidC++Server API

floo::BMXGroupService#

Group Service

#include <bmx_group_service.h>

Public Types#

Name
typedef std::function< void(int percent)>Callback
typedef std::shared_ptr< [CreateGroupOptions] >CreateGroupOptionsPtr

Public Functions#

Name
virtual~BMXGroupService()
virtual BMXErrorCodeget(BMXGroupList & list, bool forceRefresh) =0
Get group list, pull from server if forceRefreshed is set
virtual BMXErrorCodesearch(BMXGroupList & list, bool forceRefresh) =0
Deprecated.
virtual BMXErrorCodefetchGroupsByIdList(const std::vector< int64_t > & groupIdList, BMXGroupList & list, bool forceRefresh) =0
Get a list of group information from the ID list passed in to group, or pull from server if forceRefresh is set
virtual BMXErrorCodesearch(const std::vector< int64_t > & groupIdList, BMXGroupList & list, bool forceRefresh) =0
Deprecated.
virtual BMXErrorCodefetchGroupById(int64_t groupId, BMXGroupPtr & group, bool forceRefresh) =0
Get group information by group id, or pull from server if forceRefresh is set
virtual BMXErrorCodesearch(int64_t groupId, BMXGroupPtr & group, bool forceRefresh) =0
Deprecated.
virtual BMXErrorCodefetchLocalGroupsByName(BMXGroupList & list, const std::string & name) =0
Query local group information by group name and retrieve the group from local database by group name query
virtual BMXErrorCodesearch(BMXGroupList & list, const std::string & name) =0
Deprecated.
virtual BMXErrorCodecreate(const [CreateGroupOptions] & options, BMXGroupPtr & group) =0
Create group
virtual BMXErrorCodedestroy(BMXGroupPtr group) =0
Destroy group
virtual BMXErrorCodejoin(BMXGroupPtr group, const std::string & message) =0
Join a group, which may require admin approval depending on group settings
virtual BMXErrorCodeleave(BMXGroupPtr group) =0
Quit group
virtual BMXErrorCodegetInfo(BMXGroupPtr group) =0
Get group details, pull the latest information from server
virtual BMXErrorCodegetMembersNickname(BMXGroupPtr group, const std::vector< int64_t > & members, BMXGroup::MemberList & list) =0
Get group member details
virtual BMXErrorCodegetInvitationList(BMXGroupInvitationPagePtr & result, const std::string & cursor ="", int pageSize =10) =0
Get group invitation list in pages
virtual BMXErrorCodegetApplicationList(BMXGroupList list, BMXGroupApplicationPagePtr & result, const std::string & cursor ="", int pageSize =10) =0
Get a list of group applications in pages
virtual BMXErrorCodegetMembers(BMXGroupPtr group, BMXGroupMemberResultPagePtr & result, const std::string & cursor ="", int pageSize =200) =0
Get list of group members in pages, pull from server if forceRefresh is set, up to 500 per page.
virtual BMXErrorCodegetMembers(BMXGroupPtr group, BMXGroup::MemberList & list, bool forceRefresh) =0
Get group member list, pull from server if forceRefresh is set, up to 1,000
virtual BMXErrorCodeaddMembers(BMXGroupPtr group, const std::vector< int64_t > & members, const std::string & message) =0
Add group member
virtual BMXErrorCoderemoveMembers(BMXGroupPtr group, const std::vector< int64_t > & members, const std::string & reason) =0
Remove group member
virtual BMXErrorCodeaddAdmins(BMXGroupPtr group, const std::vector< int64_t > & admins, const std::string & message) =0
Add Admin
virtual BMXErrorCoderemoveAdmins(BMXGroupPtr group, const std::vector< int64_t > & admins, const std::string & reason) =0
Remove admin
virtual BMXErrorCodegetAdmins(BMXGroupPtr group, BMXGroup::MemberList & list, bool forceRefresh) =0
Get Admins list, pull from server if forceRefreshed is set
virtual BMXErrorCodeblockMembers(BMXGroupPtr group, const std::vector< int64_t > & members) =0
Add to blacklist
virtual BMXErrorCodeunblockMembers(BMXGroupPtr group, const std::vector< int64_t > & members) =0
Unblacklist
virtual BMXErrorCodegetBlockList(BMXGroupPtr group, BMXGroupMemberResultPagePtr & result, const std::string & cursor ="", int pageSize =200) =0
Paged to get blacklist
virtual BMXErrorCodegetBlockList(BMXGroupPtr group, BMXGroup::MemberList & list, bool forceRefresh) =0
Get blacklist
virtual BMXErrorCodebanMembers(BMXGroupPtr group, const std::vector< int64_t > & members, int64_t duration, const std::string & reason ="") =0
Ban
virtual BMXErrorCodebanGroup(BMXGroupPtr group, int64_t duration) =0
Ban all members, the expiration time is calculated from the current server time plus banning duration (only Admins and group Owner can speak in the duration)
virtual BMXErrorCodeunbanMembers(BMXGroupPtr group, const std::vector< int64_t > & members) =0
Unban
virtual BMXErrorCodeunbanGroup(BMXGroupPtr group) =0
Unban all members
virtual BMXErrorCodegetBannedMembers(BMXGroupPtr group, BMXGroupBannedMemberResultPagePtr & result, const std::string & cursor ="", int pageSize =200) =0
Paged to get ban list
virtual BMXErrorCodegetBannedMembers(BMXGroupPtr group, BMXGroup::BannedMemberList & list) =0
Get a list of banned members
virtual BMXErrorCodemuteMessage(BMXGroupPtr group, BMXGroup::MsgMuteMode mode) =0
Set whether to block group messages
virtual BMXErrorCodeacceptApplication(BMXGroupPtr group, int64_t applicantId) =0
Accept application of membership
virtual BMXErrorCodedeclineApplication(BMXGroupPtr group, int64_t applicantId, const std::string & reason ="") =0
Reject application of membership
virtual BMXErrorCodeacceptInvitation(BMXGroupPtr group, int64_t inviter) =0
Accept to join group
virtual BMXErrorCodedeclineInvitation(BMXGroupPtr group, int64_t inviter, const std::string & reason ="") =0
Reject invitation to join group
virtual BMXErrorCodetransferOwner(BMXGroupPtr group, int64_t newOwnerId) =0
Transfer of group Owner
virtual BMXErrorCodeuploadSharedFile(BMXGroupPtr group, const std::string & filePath, const std::string & displayName, const std::string & extensionName, Callback ) =0
Add shared file in group
virtual BMXErrorCodecancelUploadSharedFile(BMXGroupPtr group, const std::string & filePath) =0
Cancel uploading group shared files
virtual BMXErrorCoderemoveSharedFile(BMXGroupPtr group, BMXGroup::SharedFilePtr sharedFile) =0
Remove shared file in group
virtual BMXErrorCodedownloadSharedFile(BMXGroupPtr group, BMXGroup::SharedFilePtr sharedFile, Callback ) =0
Download share file in group
virtual BMXErrorCodecancelDownloadSharedFile(BMXGroupPtr group, BMXGroup::SharedFilePtr sharedFile) =0
Cancel downloading group shared files
virtual BMXErrorCodegetSharedFilesList(BMXGroupPtr group, BMXGroup::SharedFileList & list, bool forceRefresh) =0
Get a list of share files in group
virtual BMXErrorCodechangeSharedFileName(BMXGroupPtr group, BMXGroup::SharedFilePtr sharedFile, const std::string & name) =0
Modify shared file name in group
virtual BMXErrorCodegetLatestAnnouncement(BMXGroupPtr group, BMXGroup::AnnouncementPtr & announcement, bool forceRefresh) =0
Get the latest group announcement
virtual BMXErrorCodegetAnnouncementList(BMXGroupPtr group, BMXGroup::AnnouncementList & list, bool forceRefresh) =0
Get group announcements list
virtual BMXErrorCodeeditAnnouncement(BMXGroupPtr group, const std::string & title, const std::string & content) =0
Write group announcement
virtual BMXErrorCodedeleteAnnouncement(BMXGroupPtr group, int64_t announcementId) =0
Delete group announcement
virtual BMXErrorCodesetName(BMXGroupPtr group, const std::string & name) =0
Set group name
virtual BMXErrorCodesetDescription(BMXGroupPtr group, const std::string & description) =0
Set group description
virtual BMXErrorCodesetExtension(BMXGroupPtr group, const std::string & extension) =0
Set group extension information
virtual BMXErrorCodesetMyNickname(BMXGroupPtr group, const std::string & nickname) =0
Set nickname in group
virtual BMXErrorCodesetMsgPushMode(BMXGroupPtr group, BMXGroup::MsgPushMode mode) =0
Set group message notification mode
virtual BMXErrorCodesetJoinAuthMode(BMXGroupPtr group, BMXGroup::JoinAuthMode mode) =0
Set approval mode for joining group
virtual BMXErrorCodesetInviteMode(BMXGroupPtr group, BMXGroup::InviteMode mode) =0
Set invitation mode
virtual BMXErrorCodesetAllowMemberModify(BMXGroupPtr group, bool enable) =0
Set whether group members are allowed to set group information
virtual BMXErrorCodesetEnableReadAck(BMXGroupPtr group, bool enable) =0
Set whether group message read acknowledgement is enabled
virtual BMXErrorCodesetHistoryVisible(BMXGroupPtr group, bool enable) =0
Set whether group members are allowed to enable visible message history
virtual BMXErrorCodesetAvatar(BMXGroupPtr group, const std::string & avatarPath, Callback ) =0
Set group avatar
virtual BMXErrorCodedownloadAvatar(BMXGroupPtr group, bool thumbnail, Callback callback) =0
Download group avatar
virtual voidaddGroupListener(BMXGroupServiceListener * listener) =0
Add group change listener
virtual voidremoveGroupListener(BMXGroupServiceListener * listener) =0
Remove group change listener

Protected Functions#

Public Types Documentation#

typedef Callback#

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

typedef CreateGroupOptionsPtr#

typedef std::shared_ptr<CreateGroupOptions> floo::BMXGroupService::CreateGroupOptionsPtr;

Public Functions Documentation#

function ~BMXGroupService#

inline virtual ~BMXGroupService()

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXGroupService",function="~BMXGroupService" %}{% endlanying_code_snippet %}

function get#

virtual BMXErrorCode get(
    BMXGroupList & list,
    bool forceRefresh
) =0

Get group list, pull from server if forceRefreshed is set

Parameters:

  • list List of group ids, pass in an empty list function and fetch the returned result here
  • forceRefresh True to force fetch from server, sdk will fetch from server automatically if local fetch failed

Return: BMXErrorCode

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXGroupService",function="get" %}{% endlanying_code_snippet %}
virtual BMXErrorCode search(
    BMXGroupList & list,
    bool forceRefresh
) =0

Deprecated.

Parameters:

  • list List of group ids, pass in an empty list function and fetch the returned result here
  • forceRefresh True to force fetch from server, sdk will fetch from server automatically if local fetch failed

Return: BMXErrorCode

use get instead.

Get group list, pull from server if forceRefreshed is set

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXGroupService",function="search" %}{% endlanying_code_snippet %}

function fetchGroupsByIdList#

virtual BMXErrorCode fetchGroupsByIdList(
    const std::vector< int64_t > & groupIdList,
    BMXGroupList & list,
    bool forceRefresh
) =0

Get a list of group information from the ID list passed in to group, or pull from server if forceRefresh is set

Parameters:

  • groupIdList List of group ids
  • list List of group details, pass in an empty list function and fetch the returned result here
  • forceRefresh True to force fetch from server, sdk will fetch from server automatically if local fetch failed

Return: BMXErrorCode

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXGroupService",function="fetchGroupsByIdList" %}{% endlanying_code_snippet %}

function search#

virtual BMXErrorCode search(
    const std::vector< int64_t > & groupIdList,
    BMXGroupList & list,
    bool forceRefresh
) =0

Deprecated.

Parameters:

  • groupIdList List of group ids
  • list List of group details, pass in an empty list function and fetch the returned result here
  • forceRefresh True to force fetch from server, sdk will fetch from server automatically if local fetch failed

Return: BMXErrorCode

use fetchGroupsByIdList instead.

Get the list of group information for the incoming group id, pull from server if forceRefreshed is set

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXGroupService",function="search" %}{% endlanying_code_snippet %}

function fetchGroupById#

virtual BMXErrorCode fetchGroupById(
    int64_t groupId,
    BMXGroupPtr & group,
    bool forceRefresh
) =0

Get group information by group id, or pull from server if forceRefresh is set

Parameters:

  • groupId Group id to search
  • group Group information returned by search, pass in a pointing-to-empty shared_ptr objective function and fetch the returned result here
  • forceRefresh True to force fetch from server, sdk will fetch from server automatically if local fetch failed

Return: BMXErrorCode

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXGroupService",function="fetchGroupById" %}{% endlanying_code_snippet %}

function search#

virtual BMXErrorCode search(
    int64_t groupId,
    BMXGroupPtr & group,
    bool forceRefresh
) =0

Deprecated.

Parameters:

  • groupId Group id to search
  • group Group information returned by search, pass in a pointing-to-empty shared_ptr objective function and fetch the returned result here
  • forceRefresh True to force fetch from server, sdk will fetch from server automatically if local fetch failed

Return: BMXErrorCode

use fetchGroupById instead.

Get group information, pull from server if forceRefreshed is set

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXGroupService",function="search" %}{% endlanying_code_snippet %}

function fetchLocalGroupsByName#

virtual BMXErrorCode fetchLocalGroupsByName(
    BMXGroupList & list,
    const std::string & name
) =0

Query local group information by group name and retrieve the group from local database by group name query

Parameters:

  • list Group list information returned by search result
  • name Keyword of group name for query

Return: BMXErrorCode

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXGroupService",function="fetchLocalGroupsByName" %}{% endlanying_code_snippet %}

function search#

virtual BMXErrorCode search(
    BMXGroupList & list,
    const std::string & name
) =0

Deprecated.

Parameters:

  • list Group list information returned by search result
  • name Keyword of group name for query

Return: BMXErrorCode

use fetchLocalGroupsByName instead.

Query local group information by group name and retrieve the group from local database by group name query

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXGroupService",function="search" %}{% endlanying_code_snippet %}

function create#

virtual BMXErrorCode create(
    const CreateGroupOptions & options,
    BMXGroupPtr & group
) =0

Create group

Parameters:

  • options Parameters passed in when creating a group
  • group Returned result of creation, pass in a pointing-to-empty objective function shared_ptr and fetch the returned result here

Return: BMXErrorCode

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXGroupService",function="create" %}{% endlanying_code_snippet %}

function destroy#

virtual BMXErrorCode destroy(
    BMXGroupPtr group
) =0

Destroy group

Parameters:

  • group Group to destroy

Return: BMXErrorCode

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXGroupService",function="destroy" %}{% endlanying_code_snippet %}

function join#

virtual BMXErrorCode join(
    BMXGroupPtr group,
    const std::string & message
) =0

Join a group, which may require admin approval depending on group settings

Parameters:

  • group Group to join
  • message Information for group membership application

Return: BMXErrorCode

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXGroupService",function="join" %}{% endlanying_code_snippet %}

function leave#

virtual BMXErrorCode leave(
    BMXGroupPtr group
) =0

Quit group

Parameters:

  • group Group to quit

Return: BMXErrorCode

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXGroupService",function="leave" %}{% endlanying_code_snippet %}

function getInfo#

virtual BMXErrorCode getInfo(
    BMXGroupPtr group
) =0

Get group details, pull the latest information from server

Parameters:

  • group Group for which the latest information needs to be obtained

Return: BMXErrorCode

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXGroupService",function="getInfo" %}{% endlanying_code_snippet %}

function getMembersNickname#

virtual BMXErrorCode getMembersNickname(
    BMXGroupPtr group,
    const std::vector< int64_t > & members,
    BMXGroup::MemberList & list
) =0

Get group member details

Parameters:

  • group Group to operate on
  • members Group member id to get group member details
  • list Returned group member details, pass in an empty list function and fetch the returned list of group member details here

Return: BMXErrorCode

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXGroupService",function="getMembersNickname" %}{% endlanying_code_snippet %}

function getInvitationList#

virtual BMXErrorCode getInvitationList(
    BMXGroupInvitationPagePtr & result,
    const std::string & cursor ="",
    int pageSize =10
) =0

Get group invitation list in pages

Parameters:

  • result Paged list of group invitations, pass in a pointing-to-empty shared_ptr objective function and fetch the returned result here
  • cursor Paged starting cursor, passed in as empty-valued first, followed by the cursor in the result returned by last operation
  • pageSize Page size

Return: BMXErrorCode

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXGroupService",function="getInvitationList" %}{% endlanying_code_snippet %}

function getApplicationList#

virtual BMXErrorCode getApplicationList(
    BMXGroupList list,
    BMXGroupApplicationPagePtr & result,
    const std::string & cursor ="",
    int pageSize =10
) =0

Get a list of group applications in pages

Parameters:

  • list List of group ids for which group application list information needs to be obtained
  • result Paged list of group applications, pass in a pointing-to-emtpy shared_ptr objective function and fetch the returned result here
  • cursor Paged starting cursor, passed in as empty-valued first, followed by the cursor in the result returned by last operation
  • pageSize Page size

Return: BMXErrorCode

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXGroupService",function="getApplicationList" %}{% endlanying_code_snippet %}

function getMembers#

virtual BMXErrorCode getMembers(
    BMXGroupPtr group,
    BMXGroupMemberResultPagePtr & result,
    const std::string & cursor ="",
    int pageSize =200
) =0

Get list of group members in pages, pull from server if forceRefresh is set, up to 500 per page.

Parameters:

  • group Group to operate on
  • result Paged list of group members, pass in a pointing-to-empty shared_ptr objective function and fetch the returned result here
  • cursor Paged starting cursor, passed in as empty-valued first, followed by the cursor in the result returned by last operation
  • pageSize Page size

Return: BMXErrorCode

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXGroupService",function="getMembers" %}{% endlanying_code_snippet %}

function getMembers#

virtual BMXErrorCode getMembers(
    BMXGroupPtr group,
    BMXGroup::MemberList & list,
    bool forceRefresh
) =0

Get group member list, pull from server if forceRefresh is set, up to 1,000

Parameters:

  • group Group to operate on
  • list List of group members, pass in an empty list function and fetch the returned list of group details
  • forceRefresh True to force fetch from server, sdk will fetch from server automatically if local fetch failed

Return: BMXErrorCode

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXGroupService",function="getMembers" %}{% endlanying_code_snippet %}

function addMembers#

virtual BMXErrorCode addMembers(
    BMXGroupPtr group,
    const std::vector< int64_t > & members,
    const std::string & message
) =0

Add group member

Parameters:

  • group Group to operate on
  • members List of member ids to join group
  • message Reason for membership application

Return: BMXErrorCode

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXGroupService",function="addMembers" %}{% endlanying_code_snippet %}

function removeMembers#

virtual BMXErrorCode removeMembers(
    BMXGroupPtr group,
    const std::vector< int64_t > & members,
    const std::string & reason
) =0

Remove group member

Parameters:

  • group Group to operate on
  • members List of group member ids to delete
  • reason Reason for deletion

Return: BMXErrorCode

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXGroupService",function="removeMembers" %}{% endlanying_code_snippet %}

function addAdmins#

virtual BMXErrorCode addAdmins(
    BMXGroupPtr group,
    const std::vector< int64_t > & admins,
    const std::string & message
) =0

Add Admin

Parameters:

  • group Group to operate on
  • admins List of member ids to be added as Admins
  • message Reason for adding as Admin

Return: BMXErrorCode

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXGroupService",function="addAdmins" %}{% endlanying_code_snippet %}

function removeAdmins#

virtual BMXErrorCode removeAdmins(
    BMXGroupPtr group,
    const std::vector< int64_t > & admins,
    const std::string & reason
) =0

Remove admin

Parameters:

  • group Group to operate on
  • admins List of member ids to degrade from Admins
  • reason Reason to degrade from Admin

Return: BMXErrorCode

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXGroupService",function="removeAdmins" %}{% endlanying_code_snippet %}

function getAdmins#

virtual BMXErrorCode getAdmins(
    BMXGroupPtr group,
    BMXGroup::MemberList & list,
    bool forceRefresh
) =0

Get Admins list, pull from server if forceRefreshed is set

Parameters:

  • group Group to operate on
  • list List of group Admins, pass in an empty list function and fetch the returned result here
  • forceRefresh True to force fetch from server, sdk will fetch from server automatically if local fetch failed

Return: BMXErrorCode

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXGroupService",function="getAdmins" %}{% endlanying_code_snippet %}

function blockMembers#

virtual BMXErrorCode blockMembers(
    BMXGroupPtr group,
    const std::vector< int64_t > & members
) =0

Add to blacklist

Parameters:

  • group Group to operate on
  • members List of member ids to be blacklisted

Return: BMXErrorCode

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXGroupService",function="blockMembers" %}{% endlanying_code_snippet %}

function unblockMembers#

virtual BMXErrorCode unblockMembers(
    BMXGroupPtr group,
    const std::vector< int64_t > & members
) =0

Unblacklist

Parameters:

  • group Group to operate on
  • members List of unblacklisted user ids

Return: BMXErrorCode

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXGroupService",function="unblockMembers" %}{% endlanying_code_snippet %}

function getBlockList#

virtual BMXErrorCode getBlockList(
    BMXGroupPtr group,
    BMXGroupMemberResultPagePtr & result,
    const std::string & cursor ="",
    int pageSize =200
) =0

Paged to get blacklist

Parameters:

  • group Group to operate on
  • result Paged list of blacklists, pass in a pointing-to-empty shared_ptr objective function and fetch the returned result here
  • cursor Paged starting cursor, passed in as empty-valued first, followed by the cursor in the result returned by last operation
  • pageSize Page size

Return: BMXErrorCode

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXGroupService",function="getBlockList" %}{% endlanying_code_snippet %}

function getBlockList#

virtual BMXErrorCode getBlockList(
    BMXGroupPtr group,
    BMXGroup::MemberList & list,
    bool forceRefresh
) =0

Get blacklist

Parameters:

  • group Group to operate on
  • list List of group blacklists, pass in an empty list function and fetch the returned list of group details here
  • forceRefresh True to force fetch from server, sdk will fetch from server automatically if local fetch failed

Return: BMXErrorCode

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXGroupService",function="getBlockList" %}{% endlanying_code_snippet %}

function banMembers#

virtual BMXErrorCode banMembers(
    BMXGroupPtr group,
    const std::vector< int64_t > & members,
    int64_t duration,
    const std::string & reason =""
) =0

Ban

Parameters:

  • group Group to operate on
  • members List of banned member ids
  • duration Duration of banned
  • reason Reason for banned

Return: BMXErrorCode

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXGroupService",function="banMembers" %}{% endlanying_code_snippet %}

function banGroup#

virtual BMXErrorCode banGroup(
    BMXGroupPtr group,
    int64_t duration
) =0

Ban all members, the expiration time is calculated from the current server time plus banning duration (only Admins and group Owner can speak in the duration)

Parameters:

  • group Group to operate on
  • duration Banning duration (minute)

Return: BMXErrorCode

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXGroupService",function="banGroup" %}{% endlanying_code_snippet %}

function unbanMembers#

virtual BMXErrorCode unbanMembers(
    BMXGroupPtr group,
    const std::vector< int64_t > & members
) =0

Unban

Parameters:

  • group Group to operate on
  • members List of unbanned group member ids

Return: BMXErrorCode

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXGroupService",function="unbanMembers" %}{% endlanying_code_snippet %}

function unbanGroup#

virtual BMXErrorCode unbanGroup(
    BMXGroupPtr group
) =0

Unban all members

Parameters:

  • group Group to operate on

Return: BMXErrorCode

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXGroupService",function="unbanGroup" %}{% endlanying_code_snippet %}

function getBannedMembers#

virtual BMXErrorCode getBannedMembers(
    BMXGroupPtr group,
    BMXGroupBannedMemberResultPagePtr & result,
    const std::string & cursor ="",
    int pageSize =200
) =0

Paged to get ban list

Parameters:

  • group Group to operate on
  • result Paged ban list, pass in a pointing-to-empty shared_ptr objective function and fetch the returned result here
  • cursor Paged starting cursor, passed in as empty-valued first, followed by the cursor in the result returned by last operation
  • pageSize Page size

Return: BMXErrorCode

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXGroupService",function="getBannedMembers" %}{% endlanying_code_snippet %}

function getBannedMembers#

virtual BMXErrorCode getBannedMembers(
    BMXGroupPtr group,
    BMXGroup::BannedMemberList & list
) =0

Get a list of banned members

Parameters:

  • group Group to operate on
  • list Group ban list, pass in an empty list function and fetch the returned list of group details here

Return: BMXErrorCode

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXGroupService",function="getBannedMembers" %}{% endlanying_code_snippet %}

function muteMessage#

virtual BMXErrorCode muteMessage(
    BMXGroupPtr group,
    BMXGroup::MsgMuteMode mode
) =0

Set whether to block group messages

Parameters:

  • group Group to operate on
  • mode Group blocking mode

Return: BMXErrorCode

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXGroupService",function="muteMessage" %}{% endlanying_code_snippet %}

function acceptApplication#

virtual BMXErrorCode acceptApplication(
    BMXGroupPtr group,
    int64_t applicantId
) =0

Accept application of membership

Parameters:

  • group Group to operate on
  • applicantId User id that request to join group

Return: BMXErrorCode

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXGroupService",function="acceptApplication" %}{% endlanying_code_snippet %}

function declineApplication#

virtual BMXErrorCode declineApplication(
    BMXGroupPtr group,
    int64_t applicantId,
    const std::string & reason =""
) =0

Reject application of membership

Parameters:

  • group Group to operate on
  • applicantId User id that request to join group
  • reason Reason for rejection

Return: BMXErrorCode

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXGroupService",function="declineApplication" %}{% endlanying_code_snippet %}

function acceptInvitation#

virtual BMXErrorCode acceptInvitation(
    BMXGroupPtr group,
    int64_t inviter
) =0

Accept to join group

Parameters:

  • group Group to operate on
  • inviter Inviter id

Return: BMXErrorCode

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXGroupService",function="acceptInvitation" %}{% endlanying_code_snippet %}

function declineInvitation#

virtual BMXErrorCode declineInvitation(
    BMXGroupPtr group,
    int64_t inviter,
    const std::string & reason =""
) =0

Reject invitation to join group

Parameters:

  • group Group to operate on
  • inviter Inviter id
  • reason Reason for rejection

Return: BMXErrorCode

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXGroupService",function="declineInvitation" %}{% endlanying_code_snippet %}

function transferOwner#

virtual BMXErrorCode transferOwner(
    BMXGroupPtr group,
    int64_t newOwnerId
) =0

Transfer of group Owner

Parameters:

  • group Group to operate on
  • newOwnerId User id that transferred as new group Owner

Return: BMXErrorCode

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXGroupService",function="transferOwner" %}{% endlanying_code_snippet %}

function uploadSharedFile#

virtual BMXErrorCode uploadSharedFile(
    BMXGroupPtr group,
    const std::string & filePath,
    const std::string & displayName,
    const std::string & extensionName,
    Callback 
) =0

Add shared file in group

Parameters:

  • group Group to operate on
  • filePath Local path of file
  • displayName File display name
  • extensionName File extension name
  • Callback Upload callback function

Return: BMXErrorCode

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXGroupService",function="uploadSharedFile" %}{% endlanying_code_snippet %}

function cancelUploadSharedFile#

virtual BMXErrorCode cancelUploadSharedFile(
    BMXGroupPtr group,
    const std::string & filePath
) =0

Cancel uploading group shared files

Parameters:

  • group Group to operate on
  • filePath Local path of file

Return: BMXErrorCode

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXGroupService",function="cancelUploadSharedFile" %}{% endlanying_code_snippet %}

function removeSharedFile#

virtual BMXErrorCode removeSharedFile(
    BMXGroupPtr group,
    BMXGroup::SharedFilePtr sharedFile
) =0

Remove shared file in group

Parameters:

  • group Group to operate on
  • sharedFile Deleted group shared file

Return: BMXErrorCode

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXGroupService",function="removeSharedFile" %}{% endlanying_code_snippet %}

function downloadSharedFile#

virtual BMXErrorCode downloadSharedFile(
    BMXGroupPtr group,
    BMXGroup::SharedFilePtr sharedFile,
    Callback 
) =0

Download share file in group

Parameters:

  • group Group to operate on
  • sharedFile Downloaded group shared files
  • Callback Download callback function

Return: BMXErrorCode

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXGroupService",function="downloadSharedFile" %}{% endlanying_code_snippet %}

function cancelDownloadSharedFile#

virtual BMXErrorCode cancelDownloadSharedFile(
    BMXGroupPtr group,
    BMXGroup::SharedFilePtr sharedFile
) =0

Cancel downloading group shared files

Parameters:

  • group Group to operate on
  • sharedFile Downloaded group shared files

Return: BMXErrorCode

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXGroupService",function="cancelDownloadSharedFile" %}{% endlanying_code_snippet %}

function getSharedFilesList#

virtual BMXErrorCode getSharedFilesList(
    BMXGroupPtr group,
    BMXGroup::SharedFileList & list,
    bool forceRefresh
) =0

Get a list of share files in group

Parameters:

  • group Group to operate on
  • list List of group shared files, pass in an empty list function and fetch the returned list of group details here
  • forceRefresh True to force fetch from server, sdk will fetch from server automatically if local fetch failed

Return: BMXErrorCode

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXGroupService",function="getSharedFilesList" %}{% endlanying_code_snippet %}

function changeSharedFileName#

virtual BMXErrorCode changeSharedFileName(
    BMXGroupPtr group,
    BMXGroup::SharedFilePtr sharedFile,
    const std::string & name
) =0

Modify shared file name in group

Parameters:

  • group Group to operate on
  • sharedFile Group shared file to change
  • name Modified group shared file name

Return: BMXErrorCode

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXGroupService",function="changeSharedFileName" %}{% endlanying_code_snippet %}

function getLatestAnnouncement#

virtual BMXErrorCode getLatestAnnouncement(
    BMXGroupPtr group,
    BMXGroup::AnnouncementPtr & announcement,
    bool forceRefresh
) =0

Get the latest group announcement

Parameters:

  • group Group to operate on
  • announcement Latest group announcement, pass in a pointing-to-empty shared_ptr objective function and fetch the latest group announcement here
  • forceRefresh True to force fetch from server, sdk will fetch from server automatically if local fetch failed

Return: BMXErrorCode

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXGroupService",function="getLatestAnnouncement" %}{% endlanying_code_snippet %}

function getAnnouncementList#

virtual BMXErrorCode getAnnouncementList(
    BMXGroupPtr group,
    BMXGroup::AnnouncementList & list,
    bool forceRefresh
) =0

Get group announcements list

Parameters:

  • group Group to operate on
  • list List of group announcements, pass in an empty list function and fetch the returned result here
  • forceRefresh True to force fetch from server, sdk will fetch from server automatically if local fetch failed

Return: BMXErrorCode

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXGroupService",function="getAnnouncementList" %}{% endlanying_code_snippet %}

function editAnnouncement#

virtual BMXErrorCode editAnnouncement(
    BMXGroupPtr group,
    const std::string & title,
    const std::string & content
) =0

Write group announcement

Parameters:

  • group Group to operate on
  • title Tittle of group announcement
  • content Content of group announcement

Return: BMXErrorCode

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXGroupService",function="editAnnouncement" %}{% endlanying_code_snippet %}

function deleteAnnouncement#

virtual BMXErrorCode deleteAnnouncement(
    BMXGroupPtr group,
    int64_t announcementId
) =0

Delete group announcement

Parameters:

  • group Group to operate on
  • announcementId Deleted group announcement id

Return: BMXErrorCode

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXGroupService",function="deleteAnnouncement" %}{% endlanying_code_snippet %}

function setName#

virtual BMXErrorCode setName(
    BMXGroupPtr group,
    const std::string & name
) =0

Set group name

Parameters:

  • group Group to operate on
  • name Group name

Return: BMXErrorCode

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXGroupService",function="setName" %}{% endlanying_code_snippet %}

function setDescription#

virtual BMXErrorCode setDescription(
    BMXGroupPtr group,
    const std::string & description
) =0

Set group description

Parameters:

  • group Group to operate on
  • description Group description

Return: BMXErrorCode

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXGroupService",function="setDescription" %}{% endlanying_code_snippet %}

function setExtension#

virtual BMXErrorCode setExtension(
    BMXGroupPtr group,
    const std::string & extension
) =0

Set group extension information

Parameters:

  • group Group to operate on
  • extension Group extension information

Return: BMXErrorCode

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXGroupService",function="setExtension" %}{% endlanying_code_snippet %}

function setMyNickname#

virtual BMXErrorCode setMyNickname(
    BMXGroupPtr group,
    const std::string & nickname
) =0

Set nickname in group

Parameters:

  • group Group to operate on
  • nickname My nickname in group

Return: BMXErrorCode

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXGroupService",function="setMyNickname" %}{% endlanying_code_snippet %}

function setMsgPushMode#

virtual BMXErrorCode setMsgPushMode(
    BMXGroupPtr group,
    BMXGroup::MsgPushMode mode
) =0

Set group message notification mode

Parameters:

  • group Group to operate on
  • mode Group message notification mode

Return: BMXErrorCode

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXGroupService",function="setMsgPushMode" %}{% endlanying_code_snippet %}

function setJoinAuthMode#

virtual BMXErrorCode setJoinAuthMode(
    BMXGroupPtr group,
    BMXGroup::JoinAuthMode mode
) =0

Set approval mode for joining group

Parameters:

  • group Group to operate on
  • mode Join approval mode

Return: BMXErrorCode

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXGroupService",function="setJoinAuthMode" %}{% endlanying_code_snippet %}

function setInviteMode#

virtual BMXErrorCode setInviteMode(
    BMXGroupPtr group,
    BMXGroup::InviteMode mode
) =0

Set invitation mode

Parameters:

  • group Group to operate on
  • mode Group invitation mode

Return: BMXErrorCode

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXGroupService",function="setInviteMode" %}{% endlanying_code_snippet %}

function setAllowMemberModify#

virtual BMXErrorCode setAllowMemberModify(
    BMXGroupPtr group,
    bool enable
) =0

Set whether group members are allowed to set group information

Parameters:

  • group Group to operate on
  • enable Whether allowed to operate

Return: BMXErrorCode

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXGroupService",function="setAllowMemberModify" %}{% endlanying_code_snippet %}

function setEnableReadAck#

virtual BMXErrorCode setEnableReadAck(
    BMXGroupPtr group,
    bool enable
) =0

Set whether group message read acknowledgement is enabled

Parameters:

  • group Group to operate on
  • enable Enable or not

Return: BMXErrorCode

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXGroupService",function="setEnableReadAck" %}{% endlanying_code_snippet %}

function setHistoryVisible#

virtual BMXErrorCode setHistoryVisible(
    BMXGroupPtr group,
    bool enable
) =0

Set whether group members are allowed to enable visible message history

Parameters:

  • group Group to operate on
  • enable Enable or not

Return: BMXErrorCode

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXGroupService",function="setHistoryVisible" %}{% endlanying_code_snippet %}

function setAvatar#

virtual BMXErrorCode setAvatar(
    BMXGroupPtr group,
    const std::string & avatarPath,
    Callback 
) =0

Set group avatar

Parameters:

  • group Group to operate on
  • avatarPath Local path of group avatar file
  • Callback Upload callback function

Return: BMXErrorCode

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXGroupService",function="setAvatar" %}{% endlanying_code_snippet %}

function downloadAvatar#

virtual BMXErrorCode downloadAvatar(
    BMXGroupPtr group,
    bool thumbnail,
    Callback callback
) =0

Download group avatar

Parameters:

  • group Group to operate on
  • thumbnail True to download thumbnail, false to download original image
  • callback Download callback function

Return: BMXErrorCode

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXGroupService",function="downloadAvatar" %}{% endlanying_code_snippet %}

function addGroupListener#

virtual void addGroupListener(
    BMXGroupServiceListener * listener
) =0

Add group change listener

Parameters:

  • listener Group change listener

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXGroupService",function="addGroupListener" %}{% endlanying_code_snippet %}

function removeGroupListener#

virtual void removeGroupListener(
    BMXGroupServiceListener * listener
) =0

Remove group change listener

Parameters:

  • listener Group change listener

Protected Functions Documentation#

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXGroupService",function="removeGroupListener" %}{% endlanying_code_snippet %}

function BMXGroupService#

inline BMXGroupService()

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXGroupService",function="BMXGroupService" %}{% endlanying_code_snippet %}

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

Generated API content with concise AI notes where context helps.