Client Group API Reference
PGOS Group is a service to create a persistent grouping mechanism for players to chat and interact with each other. A player can create or join in multiple groups. Roles of group members are provided to implement various group management features.
API List
| API | Description |
|---|---|
| CreateGroup | Creat a new group. |
| SearchGroup | Search for groups that meet the specified criteria. |
| GetMyGroupList | Get all my joined groups |
| GetGroupInfo | Get information for the group. These data can be accessed by non-group members. |
| BatchGetGroupInfo | Get information for batch of groups (max 100 groups). These data can be accessed by non-group members. |
| GetGroupDetail | Get detail information for the group. These data can only be accessed by group members. |
| BatchGetGroupDetail | Get detail information for batch of groups (max 100 groups). These data can only be accessed by group members. |
| GetGroupMembers | Get members for the group. |
| GetGroupMember | Get a member of a group. |
| JoinGroup | Request to join a group. The request will failed if the join rule of the group is not Anyone. |
| LeaveGroup | Leave the group. |
| InvitePlayersToGroup | Invite some players to the group. Each player be invited will receive a OnGroupInvitation event. |
| GetGroupInvitations | Get a list of group invitations which is neither be rejected nor be accepted. |
| AcceptGroupInvitation | Accept a group invitation. |
| RejectGroupInvitation | Reject a group invitation. |
| SetMyGroupNickname | Set player's nickname of the group. |
| SetGroupName | Set name of the group. Group name could only be set by the group owner. |
| SetGroupIcon | Set icon info of the group. Group icon could only be set by the group owner. |
| SetGroupDesc | Set description of the group. Group description could only be set by the group owner or administrator. |
| SetGroupAnnouncement | Set announcement of the group. Group announcement could only be set by the group owner or administrator. |
| SetGroupTags | Set tags of the group. Group tags could only be set by the group owner or administrator. |
| SetGroupJoinRule | Set join rule of the group. Group join rule could only be set by the group owner or administrator. |
| SetGroupPublic | Set public strategy of the group. Group public strategy could only be set by the group owner or administrator. |
| SetGroupMemberRemark | Group owner and group administrator could use this api to set a group member's remark. |
| BatchSetGroupMemberRemark | Batch set remark for group members (max 100 players). |
| RemoveGroupMember | Remove a group member from the group. |
| BatchRemoveGroupMembers | Remove a list of group members from the group. (max 100 players) |
| MuteGroupMember | Mute a group member of the group. The muted group member cannot send message to group chat. |
| UnmuteGroupMember | Unmute a group member of the group. |
| TransferGroupOwnership | Transfer group ownership to a group member. |
| GrantGroupAdmin | Grant group administrator rights to a group member. |
| RevokeGroupAdmin | Revoke group administrator rights from a group member. |
| GetGroupDiscoveryList | Paging to get the number of group discoveries. You can additionally obtain the specified number of recommendation groups configured on the portal. |
| DismissGroup | Dismiss the group. |
| SendGroupTextMsg | Send group chat text message |
| SendGroupCustomMsg | Send group chat custom message |
| GetGroupMsgList | Get chat message list in a group |
| ActiveGroupChat | Set the current group chat. When setting, OnUnreadGroupMsgCountNotifyEvt will be pushed, and subsequent group chat messages currently in progress are automatically marked as read |
| GetActiveGroupChat | Get the current group chat. |
| GetGroupMentionedInfo | Get latest record mentioning me in the group. |
| ClearGroupMentionedInfo | Clear record mentioning me in the group. |
| ClearGroupUnreadCount | Mark messages in group as all read |
| ClearGroupChatMsg | Clear the group's local message records |
| SetGroupGlobalCustomData | Add or modify global custom data of a group. For group owner or administrators only. |
| DelGroupGlobalCustomData | Delete keys from global custom data of a group. For group owner or administrators only. |
| ClearGroupGlobalCustomData | Clear all global custom data of a group. For group owner or administrators only. |
| SetGroupMyPlayerCustomData | Modify group custom data for custom player. |
| BatchSetGroupPlayerCustomData | Modify group custom data for batch players (max 1000 players). Only group owner and administrators can modify other people's group custom data. |
Event List
| Event | Description |
|---|---|
| SetOnGroupInvitation | The event will be triggered when received a group invitation. |
| SetOnRemovedFromGroup | The event will be triggered when player is removed from the group. |
| SetOnMutedInGroup | The event will be triggered when player is muted in the group. |
| SetOnUnmutedInGroup | The event will be triggered when player is unmuted in the group. |
| SetOnGroupDismissed | The event will be triggered when the group is dismissed by group owner. |
| SetOnBadgeNumOfGroupInvitation | The event will be triggered when player login PGOS or the list of group invitation received changes. |
| SetOnUnreadGroupMsgCountNotify | The event will be triggered after login PGOS and when the unread count of group message changed. |
| SetOnReceiveGroupMsg | The event will be triggered when receive group chat message. |
| SetOnGroupNewMentioned | The event will be triggered when a new mention of a group is received. |
| SetOnGlobalCustomDataChanged | The event will be triggered when group global custom data changed. |
| SetOnPlayerCustomDataChanged | The event will be triggered when a group member custom changed. |
API Details
CreateGroup
Creat a new group.
/**
* Creat a new group.
*
* @param params
* @param result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void CreateGroup(
const CreateGroupParams& params,
PgosDataCallback<GroupDetail> result_callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| params | const CreateGroupParams& | |
| result_callback | PgosDataCallback<GroupDetail> | The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD. |
Return: void
SearchGroup
Search for groups that meet the specified criteria.
/**
* Search for groups that meet the specified criteria.
*
* @param params
* @param result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void SearchGroup(
const SearchGroupParams& params,
PgosDataCallback<SearchGroupRsp> result_callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| params | const SearchGroupParams& | |
| result_callback | PgosDataCallback<SearchGroupRsp> | The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD. |
Return: void
GetMyGroupList
Get all my joined groups
/**
* Get all my joined groups
*
* @param result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void GetMyGroupList(
PgosDataCallback<GetMyGroupListResult> result_callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| result_callback | PgosDataCallback<GetMyGroupListResult> | The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD. |
Return: void
GetGroupInfo
Get information for the group. These data can be accessed by non-group members.
/**
* Get information for the group. These data can be accessed by non-group members.
*
* @param group_id
* @param result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void GetGroupInfo(
const pgos::pstring& group_id,
PgosDataCallback<GroupInfo> result_callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| group_id | const std::string& | |
| result_callback | PgosDataCallback<GroupInfo> | The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD. |
Return: void
BatchGetGroupInfo
Get information for batch of groups (max 100 groups). These data can be accessed by non-group members.
/**
* Get information for batch of groups (max 100 groups). These data can be accessed by non-group members.
*
* @param group_ids
* @param result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void BatchGetGroupInfo(
const pgos::pvector<pgos::pstring>& group_ids,
PgosDataCallback<BatchGetGroupInfoRsp> result_callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| group_ids | const std::vector<std::string>& | |
| result_callback | PgosDataCallback<BatchGetGroupInfoRsp> | The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD. |
Return: void
GetGroupDetail
Get detail information for the group. These data can only be accessed by group members.
/**
* Get detail information for the group. These data can only be accessed by group members.
*
* @param group_id
* @param result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void GetGroupDetail(
const pgos::pstring& group_id,
PgosDataCallback<GroupDetail> result_callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| group_id | const std::string& | |
| result_callback | PgosDataCallback<GroupDetail> | The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD. |
Return: void
BatchGetGroupDetail
Get detail information for batch of groups (max 100 groups). These data can only be accessed by group members.
/**
* Get detail information for batch of groups (max 100 groups). These data can only be accessed by group members.
*
* @param group_ids
* @param result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void BatchGetGroupDetail(
const pgos::pvector<pgos::pstring>& group_ids,
PgosDataCallback<BatchGetGroupDetailRsp> result_callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| group_ids | const std::vector<std::string>& | |
| result_callback | PgosDataCallback<BatchGetGroupDetailRsp> | The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD. |
Return: void
GetGroupMembers
Get members for the group.
/**
* Get members for the group.
*
* @param group_id
* @param result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void GetGroupMembers(
const pgos::pstring& group_id,
PgosDataCallback<GetGroupMembersRsp> result_callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| group_id | const std::string& | |
| result_callback | PgosDataCallback<GetGroupMembersRsp> | The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD. |
Return: void
GetGroupMember
Get a member of a group.
/**
* Get a member of a group.
*
* @param group_id
* @param player_id
* @param result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void GetGroupMember(
const pgos::pstring& group_id,
const pgos::pstring& player_id,
PgosDataCallback<GetGroupMemberRsp> result_callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| group_id | const std::string& | |
| player_id | const std::string& | |
| result_callback | PgosDataCallback<GetGroupMemberRsp> | The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD. |
Return: void
JoinGroup
Request to join a group. The request will failed if the join rule of the group is not Anyone.
/**
* Request to join a group. The request will failed if the join rule of the group is not Anyone.
*
* @param group_id
* @param result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void JoinGroup(
const pgos::pstring& group_id,
PgosDataCallback<GroupDetail> result_callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| group_id | const std::string& | |
| result_callback | PgosDataCallback<GroupDetail> | The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD. |
Return: void
LeaveGroup
Leave the group.
/**
* Leave the group.
*
* @param group_id
* @param result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void LeaveGroup(
const pgos::pstring& group_id,
PgosCallback result_callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| group_id | const std::string& | |
| result_callback | PgosCallback | The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD. |
Return: void
InvitePlayersToGroup
Invite some players to the group. Each player be invited will receive a OnGroupInvitation event.
/**
* Invite some players to the group. Each player be invited will receive a OnGroupInvitation event.
*
* @param params
* @param result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void InvitePlayersToGroup(
const InvitePlayersToGroupParams& params,
PgosDataCallback<InvitePlayersToGroupRsp> result_callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| params | const InvitePlayersToGroupParams& | |
| result_callback | PgosDataCallback<InvitePlayersToGroupRsp> | The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD. |
Return: void
GetGroupInvitations
Get a list of group invitations which is neither be rejected nor be accepted.
/**
* Get a list of group invitations which is neither be rejected nor be accepted.
*
* @param result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void GetGroupInvitations(
PgosDataCallback<pgos::pvector<GroupInvitation>> result_callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| result_callback | PgosDataCallback<std::vector<GroupInvitation>> | The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD. |
Return: void
AcceptGroupInvitation
Accept a group invitation.
/**
* Accept a group invitation.
*
* @param group_id
* @param invitation_id
* @param result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void AcceptGroupInvitation(
const pgos::pstring& group_id,
const pgos::pstring& invitation_id,
PgosDataCallback<AcceptGroupInvitationRsp> result_callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| group_id | const std::string& | |
| invitation_id | const std::string& | |
| result_callback | PgosDataCallback<AcceptGroupInvitationRsp> | The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD. |
Return: void
RejectGroupInvitation
Reject a group invitation.
/**
* Reject a group invitation.
*
* @param group_id
* @param invitation_id
* @param result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void RejectGroupInvitation(
const pgos::pstring& group_id,
const pgos::pstring& invitation_id,
PgosDataCallback<RejectGroupInvitationRsp> result_callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| group_id | const std::string& | |
| invitation_id | const std::string& | |
| result_callback | PgosDataCallback<RejectGroupInvitationRsp> | The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD. |
Return: void
SetMyGroupNickname
Set player's nickname of the group.
/**
* Set player's nickname of the group.
*
* @param params
* @param result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void SetMyGroupNickname(
const SetMyGroupNicknameParams& params,
PgosCallback result_callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| params | const SetMyGroupNicknameParams& | |
| result_callback | PgosCallback | The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD. |
Return: void
SetGroupName
Set name of the group. Group name could only be set by the group owner.
/**
* Set name of the group. Group name could only be set by the group owner.
*
* @param params
* @param result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void SetGroupName(
const SetGroupNameParams& params,
PgosDataCallback<UpdateGroupRsp> result_callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| params | const SetGroupNameParams& | |
| result_callback | PgosDataCallback<UpdateGroupRsp> | The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD. |
Return: void
SetGroupIcon
Set icon info of the group. Group icon could only be set by the group owner.
/**
* Set icon info of the group. Group icon could only be set by the group owner.
*
* @param group_id
* @param group_icon
* @param result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void SetGroupIcon(
const pgos::pstring& group_id,
const pgos::pstring& group_icon,
PgosDataCallback<UpdateGroupRsp> result_callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| group_id | const std::string& | |
| group_icon | const std::string& | |
| result_callback | PgosDataCallback<UpdateGroupRsp> | The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD. |
Return: void
SetGroupDesc
Set description of the group. Group description could only be set by the group owner or administrator.
/**
* Set description of the group. Group description could only be set by the group owner or administrator.
*
* @param params
* @param result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void SetGroupDesc(
const SetGroupDescParams& params,
PgosDataCallback<UpdateGroupRsp> result_callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| params | const SetGroupDescParams& | |
| result_callback | PgosDataCallback<UpdateGroupRsp> | The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD. |
Return: void
SetGroupAnnouncement
Set announcement of the group. Group announcement could only be set by the group owner or administrator.
/**
* Set announcement of the group. Group announcement could only be set by the group owner or administrator.
*
* @param params
* @param result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void SetGroupAnnouncement(
const SetGroupAnnouncementParams& params,
PgosDataCallback<UpdateGroupRsp> result_callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| params | const SetGroupAnnouncementParams& | |
| result_callback | PgosDataCallback<UpdateGroupRsp> | The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD. |
Return: void
SetGroupTags
Set tags of the group. Group tags could only be set by the group owner or administrator.
/**
* Set tags of the group. Group tags could only be set by the group owner or administrator.
*
* @param params
* @param result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void SetGroupTags(
const SetGroupTagsParams& params,
PgosDataCallback<GroupDetail> result_callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| params | const SetGroupTagsParams& | |
| result_callback | PgosDataCallback<GroupDetail> | The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD. |
Return: void
SetGroupJoinRule
Set join rule of the group. Group join rule could only be set by the group owner or administrator.
/**
* Set join rule of the group. Group join rule could only be set by the group owner or administrator.
*
* @param group_id
* @param join_rule
* @param result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void SetGroupJoinRule(
const pgos::pstring& group_id,
GroupJoinRule join_rule,
PgosDataCallback<UpdateGroupRsp> result_callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| group_id | const std::string& | |
| join_rule | GroupJoinRule | |
| result_callback | PgosDataCallback<UpdateGroupRsp> | The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD. |
Return: void
SetGroupPublic
Set public strategy of the group. Group public strategy could only be set by the group owner or administrator.
/**
* Set public strategy of the group. Group public strategy could only be set by the group owner or administrator.
*
* @param group_id
* @param is_public
* @param result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void SetGroupPublic(
const pgos::pstring& group_id,
bool is_public,
PgosDataCallback<UpdateGroupRsp> result_callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| group_id | const std::string& | |
| is_public | bool | |
| result_callback | PgosDataCallback<UpdateGroupRsp> | The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD. |
Return: void
SetGroupMemberRemark
Group owner and group administrator could use this api to set a group member's remark.
/**
* Group owner and group administrator could use this api to set a group member's remark.
*
* @param params
* @param result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void SetGroupMemberRemark(
const SetGroupMemberRemarkParams& params,
PgosCallback result_callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| params | const SetGroupMemberRemarkParams& | |
| result_callback | PgosCallback | The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD. |
Return: void
BatchSetGroupMemberRemark
Batch set remark for group members (max 100 players).
/**
* Batch set remark for group members (max 100 players).
*
* @param params
* @param result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void BatchSetGroupMemberRemark(
const BatchSetGroupMemberRemarkParams& params,
PgosCallback result_callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| params | const BatchSetGroupMemberRemarkParams& | |
| result_callback | PgosCallback | The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD. |
Return: void
RemoveGroupMember
Remove a group member from the group.
/**
* Remove a group member from the group.
*
* @param group_id Group id
* @param player_id Player to remove
* @param result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void RemoveGroupMember(
const pgos::pstring& group_id,
const pgos::pstring& player_id,
PgosCallback result_callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| group_id | const std::string& | Group id |
| player_id | const std::string& | Player to remove |
| result_callback | PgosCallback | The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD. |
Return: void
BatchRemoveGroupMembers
Remove a list of group members from the group. (max 100 players)
/**
* Remove a list of group members from the group. (max 100 players)
*
* @param group_id Group id
* @param player_ids Players to remove
* @param result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void BatchRemoveGroupMembers(
const pgos::pstring& group_id,
const pgos::pvector<pgos::pstring>& player_ids,
PgosCallback result_callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| group_id | const std::string& | Group id |
| player_ids | const std::vector<std::string>& | Players to remove |
| result_callback | PgosCallback | The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD. |
Return: void
MuteGroupMember
Mute a group member of the group. The muted group member cannot send message to group chat.
/**
* Mute a group member of the group. The muted group member cannot send message to group chat.
*
* @param group_id
* @param player_id
* @param mute_duration_minutes The duration of the member has been muted. 0 means muted forever.
* @param result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void MuteGroupMember(
const pgos::pstring& group_id,
const pgos::pstring& player_id,
const uint32_t mute_duration_minutes,
PgosCallback result_callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| group_id | const std::string& | |
| player_id | const std::string& | |
| mute_duration_minutes | const uint32_t | The duration of the member has been muted. 0 means muted forever. |
| result_callback | PgosCallback | The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD. |
Return: void
UnmuteGroupMember
Unmute a group member of the group.
/**
* Unmute a group member of the group.
*
* @param group_id
* @param player_id
* @param result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void UnmuteGroupMember(
const pgos::pstring& group_id,
const pgos::pstring& player_id,
PgosCallback result_callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| group_id | const std::string& | |
| player_id | const std::string& | |
| result_callback | PgosCallback | The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD. |
Return: void
TransferGroupOwnership
Transfer group ownership to a group member.
/**
* Transfer group ownership to a group member.
*
* @param group_id
* @param player_id
* @param result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void TransferGroupOwnership(
const pgos::pstring& group_id,
const pgos::pstring& player_id,
PgosCallback result_callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| group_id | const std::string& | |
| player_id | const std::string& | |
| result_callback | PgosCallback | The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD. |
Return: void
GrantGroupAdmin
Grant group administrator rights to a group member.
/**
* Grant group administrator rights to a group member.
*
* @param group_id
* @param player_id
* @param result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void GrantGroupAdmin(
const pgos::pstring& group_id,
const pgos::pstring& player_id,
PgosCallback result_callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| group_id | const std::string& | |
| player_id | const std::string& | |
| result_callback | PgosCallback | The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD. |
Return: void
RevokeGroupAdmin
Revoke group administrator rights from a group member.
/**
* Revoke group administrator rights from a group member.
*
* @param group_id
* @param player_id
* @param result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void RevokeGroupAdmin(
const pgos::pstring& group_id,
const pgos::pstring& player_id,
PgosCallback result_callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| group_id | const std::string& | |
| player_id | const std::string& | |
| result_callback | PgosCallback | The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD. |
Return: void
GetGroupDiscoveryList
Paging to get the number of group discoveries. You can additionally obtain the specified number of recommendation groups configured on the portal.
/**
* Paging to get the number of group discoveries. You can additionally obtain the specified number of recommendation groups configured on the portal.
*
* @param params
* @param result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void GetGroupDiscoveryList(
const GetGroupDiscoveryListParams& params,
PgosDataCallback<GetGroupDiscoveryListResult> result_callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| params | const GetGroupDiscoveryListParams& | |
| result_callback | PgosDataCallback<GetGroupDiscoveryListResult> | The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD. |
Return: void
DismissGroup
Dismiss the group.
/**
* Dismiss the group.
*
* @param group_id
* @param result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void DismissGroup(
const pgos::pstring& group_id,
PgosCallback result_callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| group_id | const std::string& | |
| result_callback | PgosCallback | The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD. |
Return: void
SendGroupTextMsg
Send group chat text message
/**
* Send group chat text message
*
* @param params Request struct for sending text message
* @param result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void SendGroupTextMsg(
const SendGroupMsgParams& params,
PgosDataCallback<SendGroupMsgResult> result_callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| params | const SendGroupMsgParams& | Request struct for sending text message |
| result_callback | PgosDataCallback<SendGroupMsgResult> | The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD. |
Return: void
SendGroupCustomMsg
Send group chat custom message
/**
* Send group chat custom message
*
* @param params Request struct for sending custom message
* @param result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void SendGroupCustomMsg(
const SendGroupMsgParams& params,
PgosDataCallback<SendGroupMsgResult> result_callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| params | const SendGroupMsgParams& | Request struct for sending custom message |
| result_callback | PgosDataCallback<SendGroupMsgResult> | The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD. |
Return: void
GetGroupMsgList
Get chat message list in a group
/**
* Get chat message list in a group
*
* @param group_id The group ID
* @param start_seq The start sequence number of the message to query, 0 means start from the latest message.
* @param count The count of message to get
* @param result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void GetGroupMsgList(
const pgos::pstring& group_id,
int64_t start_seq,
int32_t count,
PgosDataCallback<GetGroupChatMsgListResult> result_callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| group_id | const std::string& | The group ID |
| start_seq | int64_t | The start sequence number of the message to query, 0 means start from the latest message. |
| count | int32_t | The count of message to get |
| result_callback | PgosDataCallback<GetGroupChatMsgListResult> | The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD. |
Return: void
ActiveGroupChat
Set the current group chat. When setting, OnUnreadGroupMsgCountNotifyEvt will be pushed, and subsequent group chat messages currently in progress are automatically marked as read
/**
* Set the current group chat. When setting, OnUnreadGroupMsgCountNotifyEvt will be pushed, and subsequent group chat messages currently in progress are automatically marked as read
*
* @param group_id The group to set as active
*/
void ActiveGroupChat(
const pgos::pstring& group_id);
Parameters:
| Param | Type | Description |
|---|---|---|
| group_id | const std::string& | The group to set as active |
Return: void
GetActiveGroupChat
Get the current group chat.
/**
* Get the current group chat.
*
* @return Player ID of current group chat
*/
pgos::pstring GetActiveGroupChat();
Parameters:
(No parameters)
Return: pgos::pstring
Player ID of current group chat
GetGroupMentionedInfo
Get latest record mentioning me in the group.
/**
* Get latest record mentioning me in the group.
*
* @param group_id Group ID.
* @param dst The latest record mentioned me.
* @return True if there are any mentions of me.
*/
bool GetGroupMentionedInfo(
const pgos::pstring& group_id,
GroupMentionedInfo& dst);
Parameters:
| Param | Type | Description |
|---|---|---|
| group_id | const std::string& | Group ID. |
| dst | GroupMentionedInfo& | The latest record mentioned me. |
Return: bool
True if there are any mentions of me.
ClearGroupMentionedInfo
Clear record mentioning me in the group.
/**
* Clear record mentioning me in the group.
*
* @param group_id Group ID. If empty, it means all groups
*/
void ClearGroupMentionedInfo(
const pgos::pstring& group_id);
Parameters:
| Param | Type | Description |
|---|---|---|
| group_id | const std::string& | Group ID. If empty, it means all groups |
Return: void
ClearGroupUnreadCount
Mark messages in group as all read
/**
* Mark messages in group as all read
*
* @param group_id The group ID. If empty, it means all groups
* @param result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void ClearGroupUnreadCount(
const pgos::pstring& group_id,
PgosCallback result_callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| group_id | const std::string& | The group ID. If empty, it means all groups |
| result_callback | PgosCallback | The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD. |
Return: void
ClearGroupChatMsg
Clear the group's local message records
/**
* Clear the group's local message records
*
* @param group_id The group ID. If empty, it means all groups
* @param result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void ClearGroupChatMsg(
const pgos::pstring& group_id,
PgosCallback result_callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| group_id | const std::string& | The group ID. If empty, it means all groups |
| result_callback | PgosCallback | The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD. |
Return: void
SetGroupGlobalCustomData
Add or modify global custom data of a group. For group owner or administrators only.
/**
* Add or modify global custom data of a group. For group owner or administrators only.
*
* @param result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void SetGroupGlobalCustomData(
const SetGroupGlobalCustomDataParams& params,
PgosDataCallback<SetGroupGlobalCustomDataResult> result_callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| params | const SetGroupGlobalCustomDataParams& | |
| result_callback | PgosDataCallback<SetGroupGlobalCustomDataResult> | The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD. |
Return: void
DelGroupGlobalCustomData
Delete keys from global custom data of a group. For group owner or administrators only.
/**
* Delete keys from global custom data of a group. For group owner or administrators only.
*
* @param result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void DelGroupGlobalCustomData(
const DelGroupGlobalCustomDataParams& params,
PgosDataCallback<DelGroupGlobalCustomDataResult> result_callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| params | const DelGroupGlobalCustomDataParams& | |
| result_callback | PgosDataCallback<DelGroupGlobalCustomDataResult> | The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD. |
Return: void
ClearGroupGlobalCustomData
Clear all global custom data of a group. For group owner or administrators only.
/**
* Clear all global custom data of a group. For group owner or administrators only.
*
* @param result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void ClearGroupGlobalCustomData(
const ClearGroupGlobalCustomDataParams& params,
PgosCallback result_callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| params | const ClearGroupGlobalCustomDataParams& | |
| result_callback | PgosCallback | The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD. |
Return: void
SetGroupMyPlayerCustomData
Modify group custom data for custom player.
/**
* Modify group custom data for custom player.
*
* @param result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void SetGroupMyPlayerCustomData(
const SetGroupMyPlayerCustomDataParams& params,
PgosDataCallback<SetGroupMyPlayerCustomDataResult> result_callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| params | const SetGroupMyPlayerCustomDataParams& | |
| result_callback | PgosDataCallback<SetGroupMyPlayerCustomDataResult> | The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD. |
Return: void
BatchSetGroupPlayerCustomData
Modify group custom data for batch players (max 1000 players). Only group owner and administrators can modify other people's group custom data.
/**
* Modify group custom data for batch players (max 1000 players). Only group owner and administrators can modify other people's group custom data.
*
* @param result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void BatchSetGroupPlayerCustomData(
const BatchSetGroupPlayerCustomDataParams& params,
PgosDataCallback<BatchSetGroupPlayerCustomDataResult> result_callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| params | const BatchSetGroupPlayerCustomDataParams& | |
| result_callback | PgosDataCallback<BatchSetGroupPlayerCustomDataResult> | The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD. |
Return: void
Event Details
SetOnGroupInvitation
The event will be triggered when received a group invitation.
/**
* OnSetOnGroupInvitation:
* The event will be triggered when received a group invitation.
*
* @param event Event content of group invitation.
*/
void SetOnGroupInvitation(
const GroupInvitationEvt& event);
Parameters:
| Param | Type | Description |
|---|---|---|
| event | const GroupInvitationEvt& | Event content of group invitation. |
SetOnRemovedFromGroup
The event will be triggered when player is removed from the group.
/**
* OnSetOnRemovedFromGroup:
* The event will be triggered when player is removed from the group.
*
* @param event Event content contains the group of which the player is removed from.
*/
void SetOnRemovedFromGroup(
const RemovedFromGroupEvt& event);
Parameters:
| Param | Type | Description |
|---|---|---|
| event | const RemovedFromGroupEvt& | Event content contains the group of which the player is removed from. |
SetOnMutedInGroup
The event will be triggered when player is muted in the group.
/**
* OnSetOnMutedInGroup:
* The event will be triggered when player is muted in the group.
*
* @param event Event content contains the group in which the player is muted.
*/
void SetOnMutedInGroup(
const MutedInGroupEvt& event);
Parameters:
| Param | Type | Description |
|---|---|---|
| event | const MutedInGroupEvt& | Event content contains the group in which the player is muted. |
SetOnUnmutedInGroup
The event will be triggered when player is unmuted in the group.
/**
* OnSetOnUnmutedInGroup:
* The event will be triggered when player is unmuted in the group.
*
* @param event Event content contains the group in which the player is unmuted.
*/
void SetOnUnmutedInGroup(
const UnmutedInGroupEvt& event);
Parameters:
| Param | Type | Description |
|---|---|---|
| event | const UnmutedInGroupEvt& | Event content contains the group in which the player is unmuted. |
SetOnGroupDismissed
The event will be triggered when the group is dismissed by group owner.
/**
* OnSetOnGroupDismissed:
* The event will be triggered when the group is dismissed by group owner.
*
* @param event Event content contains the group which is dismissed.
*/
void SetOnGroupDismissed(
const GroupDismissedEvt& event);
Parameters:
| Param | Type | Description |
|---|---|---|
| event | const GroupDismissedEvt& | Event content contains the group which is dismissed. |
SetOnBadgeNumOfGroupInvitation
The event will be triggered when player login PGOS or the list of group invitation received changes.
/**
* OnSetOnBadgeNumOfGroupInvitation:
* The event will be triggered when player login PGOS or the list of group invitation received changes.
*
* @param event .
*/
void SetOnBadgeNumOfGroupInvitation(
const BadgeNumOfGroupInvitationEvt& event);
Parameters:
| Param | Type | Description |
|---|---|---|
| event | const BadgeNumOfGroupInvitationEvt& | . |
SetOnUnreadGroupMsgCountNotify
The event will be triggered after login PGOS and when the unread count of group message changed.
/**
* OnSetOnUnreadGroupMsgCountNotify:
* The event will be triggered after login PGOS and when the unread count of group message changed.
*
* @param event Event result of unread message count changed.
*/
void SetOnUnreadGroupMsgCountNotify(
const UnreadMsgCountNotifyEvt& event);
Parameters:
| Param | Type | Description |
|---|---|---|
| event | const UnreadMsgCountNotifyEvt& | Event result of unread message count changed. |
SetOnReceiveGroupMsg
The event will be triggered when receive group chat message.
/**
* OnSetOnReceiveGroupMsg:
* The event will be triggered when receive group chat message.
*
* @param event Event result of receive group chat message.
*/
void SetOnReceiveGroupMsg(
const ReceiveGroupMsgEvt& event);
Parameters:
| Param | Type | Description |
|---|---|---|
| event | const ReceiveGroupMsgEvt& | Event result of receive group chat message. |
SetOnGroupNewMentioned
The event will be triggered when a new mention of a group is received.
/**
* OnSetOnGroupNewMentioned:
* The event will be triggered when a new mention of a group is received.
*
* @param event Event results received for new group mentions.
*/
void SetOnGroupNewMentioned(
const GroupNewMentionedEvt& event);
Parameters:
| Param | Type | Description |
|---|---|---|
| event | const GroupNewMentionedEvt& | Event results received for new group mentions. |
SetOnGlobalCustomDataChanged
The event will be triggered when group global custom data changed.
/**
* OnSetOnGlobalCustomDataChanged:
* The event will be triggered when group global custom data changed.
*
* @param event Event data for GlobalCustomDataChanged.
*/
void SetOnGlobalCustomDataChanged(
const GroupGlobalCustomDataChangedEvt& event);
Parameters:
| Param | Type | Description |
|---|---|---|
| event | const GroupGlobalCustomDataChangedEvt& | Event data for GlobalCustomDataChanged. |
SetOnPlayerCustomDataChanged
The event will be triggered when a group member custom changed.
/**
* OnSetOnPlayerCustomDataChanged:
* The event will be triggered when a group member custom changed.
*
* @param event Event data for PlayerCustomDataChanged.
*/
void SetOnPlayerCustomDataChanged(
const GroupPlayerCustomDataChangedEvt& event);
Parameters:
| Param | Type | Description |
|---|---|---|
| event | const GroupPlayerCustomDataChangedEvt& | Event data for PlayerCustomDataChanged. |