05/15/2024 15:19:45

Group Module

I. Overview

MSDK Group module; only WeChat and QQ support the module function.

Major functions include: create a group, join the existing group, get group state, get group relations, unbind a group, bind a group, remind the union president to build a group, get the list of groups created by the union president, and send group message; where, sending group message is WeChat channel's unique function, while QQ channel's unique functions include: bind a group, remind the union president to build a group, get the list of groups created by the union president.

function list function name WeChat QQ Remarks
Create group CreateGroup Support Support
Join the existing group JoinGroup Support Support
Get group state GetGroupState Support Support
Get group relation GetGroupRelation Support Support
Unbind group UnbindGroup Support Support
Bind group BindGroup Support
Remind the union president to create group RemindToBindGroup Support
Get the list of groups created by the union president GetGroupList Support
send group messages SendGroupMessage Support -

The union group's process
 The union president's process

Common member's process

Permission application description:

  1. QQ:
    Follow the path below to apply for login Feiying system (if you want to access the Intranet, you can contact the contact persons of Tencent operations or products to assist in the application). Path: on the left navigate bar of Feiying, find "MSDK Access"—>"Special Permission Application"—>"QQ Join and Bind Groups", and fill in the corresponding information.
    Submit the group-binding request form to the QQ Game Center's contact person, asking for arranging the manpower to configure IDIP and do other matters.
    PS: Each game shall have a corresponding contact person, who is the game's Tencent operations/products contact person. Never accessed to IDIP, the system can return Error code 221008.

  2. WeChat:
    Contact wxgame (WeChat Games Assistant) and provide the game's name and AppID to apply for enabling the permission.

Precautions on the ability of QQ joining and binding groups:

Before verifying the ability to join and bind groups, you need to make sure that the game side has completed the development of the IDIP interface (contact IDIP Assistant for scheduling) and the QQ group joining and binding platform has completed the development of the IDIP query interface. (Purpose: Used for the QQ group joining and binding platform to query whether the player is a guild member/president and query other information. After the development of the IDIP interface is completed, please contact carsonyuan for scheduling.)

II. Access Guide

2.1 Register Callback

1) Function Description

Receive MSDK Group module's callback, The game needs to register a callback function for processing.

2) Interface Declaration

C#
C++
/// <summary>
/// group's callback interface 
/// </summary>
public static event OnMSDKRetEventHandler<MSDKGroupRet> GroupRetEvent;
class MSDKGroupObserver 
{
public:
    // The group's callback interface 
    virtual void OnLoadGroupData (const MSDKGroupRet &groupRet) {}; 
};

3) Demo code

C#
C++
MSDKGroup.GroupRetEvent += OnGroupRetEvent;

public void OnGroupRetEvent (MSDKGroupRet groupRet) 
{
    string methodTag = "";
    if (groupRet.MethodNameId == (int) MSDKMethodNameID.MSDK_GROUP_CREATE) {
        methodTag = "CreateGroup";
    } else if (groupRet.MethodNameId == (int) MSDKMethodNameID.MSDK_GROUP_BIND) {
        methodTag = "BindGroup";
    } else if (groupRet.MethodNameId == (int) MSDKMethodNameID.MSDK_GROUP_GET_GROUP_LIST) {
        methodTag = "GetGroupList";
    } else if (groupRet.MethodNameId == (int) MSDKMethodNameID.MSDK_GROUP_GET_GROUP_STATE) {
        methodTag = "GetGroupState";
    } else if (groupRet.MethodNameId == (int) MSDKMethodNameID.MSDK_GROUP_JOIN) {
        methodTag = "JoinGroup";
    } else if (groupRet.MethodNameId == (int) MSDKMethodNameID.MSDK_GROUP_UNBIND) {
        methodTag = "UnbindGroup";
    } else if (groupRet.MethodNameId == (int) MSDKMethodNameID.MSDK_GROUP_REMIND_TO_BIND) {
        methodTag = "RemindToBind";
    } else if (groupRet.MethodNameId == (int) MSDKMethodNameID.MSDK_GROUP_SEND_GROUP_MESSAGE) {
        methodTag = "SendGroupMessage";
    } else if (groupRet.MethodNameId == (int) MSDKMethodNameID.MSDK_GROUP_GET_GROUP_RELATION) {
        methodTag = "GetGroupRelation";
    }

    SampleInstance.showRetDialog (methodTag, groupRet); 
}

//Need to remove the listener when destroying it
private void OnDestroy()
{
    MSDKGroup.GroupRetEvent -= OnGroupRetEvent; 
}
MSDKGroup::SetGroupObserver(new MyGroupObserver());
class MyGroupObserver: public MSDKGroupObserver 
{
    void OnLoadGroupData (const MSDKGroupRet &groupRet) {
        handleCallBack(groupRet, groupRet.methodNameID);
    }
}

4) Data Structure

MSDKGroupRet explanation
Inherited from MSDKBaseRet; contain the basic information

member variable name type Description
Status int Status code:
1. Query the relationship between the group user and the group
a, Wechat 3: group member; 4: non-group member; -1: query failure
b, QQ 1: Group master, 2: Administrator, 3: Ordinary member, 4: Non-member, -1 Query error;
2. Query if the union is bound to WeChat's groups 0: Unbound, 1: Bound
GroupId string 1. QQ CreateGroup (create group) and GroupState (when querying whether the union is bound to the group) return the group number
2. Return empty when doing these in WeChat
GroupName string 1. QQ CreateGroup (create group) and GroupState (when querying whether the union is bound to the group) return the group number
2. Return empty when doing these in WeChat
GroupInfo List union information list, MSDKGroupInfo's data structure
1. QQ GetGroupList (when querying the group list created by the user) return the group list created by the user
2. Return empty when doing these in WeChat

2.2 Create Group

1) Function Description

① On WeChat, the union president creates a WeChat group;
② On QQ, the union president creates a QQ group. In the test environment, QQ needs to pass in areaID.
Returns and results:
When createGroup's retCode is 0, this means that the group is created successfully. You can see the new group's information on QQ/WeChat on the mobile device.5.10 and higher versions optimize the callback of QQ group creation. You can get the information of the newly created groups through the GroupId and GroupName of MSDKGroupRet.

Precautions:
1、WeChat and QQ platforms have a limit on the number of groups added to the same account. If the number exceeds the limit, an error will be reported when the relevant interface of MSDK is invoked;
2、Union ID is recommended to be random, not being incremental or having regularity.

2) Interface Declaration

C#
C++
public static void CreateGroup (string unionID, string unionName = "", string roleName = "", string zoneID = "", string roleID = "", string extraJson = "")
static void CreateGroup (String unionID, String unionName ="", String roleName ="", String zoneID ="", String roleID = "", String extraJson= "");

3) Parameter Description

Parameter Name Parameter Type Description
unionID string union ID.
QQ: A numeric value is required in the string, such as: "123456", and its length is <= 20;
WeChat: No requirement at the moment.
unionName string union name
roleName string role name in the game
zoneID string game zone server ID
QQ: A numeric value is required in the string, such as: "5678".
roleID string game role ID
extraJson string Extension field, defaulted as empty. Strictly case sensitive; reference format: {"areaID":"1","partitionID":"1","type":"1"}
areaID string Game area ID, required by QQ; the test environment must pass in a value agreed upon with IDIP. The release environment usually passes in 2 as a fixed value and can also pass in a value agreed upon with IDIP. WeChat does not need to pass in areaID
partitionID string Zone ID, optional
type string Group type, defaulted as 0 (union type); when multiple types of union groups need to be created in the game, contact the QQ side to make a schedule and provide specific values. Optional

4) Demo code

C#
C++
if (_mCurLoginChannel.Equals("QQ")) {
    string unionID = "1234";
    string unionName = "unionName";
    string roleName = "roleName";
    string zoneID = "5678";
    string roleID = "roleID";
    string extraJson = "{\"areaID\":\"1\"}"; //areaID is required;in the test environment, it is needed to pass in the value agreed with IDIP through areaID; and in the release environment, it is needed to pass in a fixed value of 2 through areaID.
    MSDKGroup.CreateGroup(unionID, unionName, roleName, zoneID, roleID,extraJson);
} else if (_mCurLoginChannel.Equals("WeChat")) {
    string unionID = "unionID";
    string unionName = "unionName";
    string roleName = "roleName";
    MSDKGroup.CreateGroup(unionID, unionName, roleName);
}
if (mCurChannel == "QQ") {
    string unionID = "1234";
    string unionName = "unionName";
    string roleName = "roleName";
    string zoneID = "5678";
    string roleID = "roleID";
    string extraJson = "{\"areaID\":\"1\"}"; ////areaID is required;in the test environment, it is needed to pass in the value agreed with IDIP through areaID; and in the release environment, it is needed to pass in a fixed value of 2 through areaID.
    MSDKGroup::CreateGroup(unionID, unionName, roleName, zoneID, roleID, extraJson);
} else if (mCurChannel == "WeChat") {
    string unionID = "unionID";
    string unionName = "unionName";
    string roleName = "roleName";
    MSDKGroup::CreateGroup(unionID, unionName, roleName);
}

2.3 Join Group

1) Function Description

Union members join existing groups.
① WeChat: Join a WeChat group. MSDK V5.8 and earlier versions only requires the union members to fill in unionID. MSDK V5.9 and later versions support setting a nickname through the extension field 'nickName' when a union member joins a union group.
② QQ: Join a QQ group. Since a union member can join multiple groups on QQ, he or she is required to fill in groupID (QQ group ID) as well as zoneID, roleID and nickName. In the test environment, QQ needs to pass in areaID (the user needs to keep the information of creating the group)
Returns and results:
When JoinGroup's retCode is 0, this indicates joining the group successfully. QQ and WeChat terminals can show the corresponding group which a union member has joined successfully.

Precautions:
1、WeChat and QQ platforms have a limit on the number of groups added to the same account. If the number exceeds the limit, an error will be reported when the relevant interface of MSDK is invoked;

2) Interface Declaration

C#
C++
public static void JoinGroup (string unionID, string zoneID = "", string roleID = "", string groupID = "", string extraJson = "")
static void JoinGroup (String unionID, String zoneID = "", String roleID = "", String groupID = "", String extraJson = "");

3) Parameter Description

Parameter Name Parameter Type Description
unionID string union ID.
QQ: A numeric value is required in the string, such as: "123456", and its length is <= 20;
WeChat: No requirement at the moment.
zoneID string game zone server ID (If the cross-zone group joining service is involved, it is needed to fill in the zone ID where the union is located)
QQ: A numeric value is required in the string, such as: "5678".
roleID string game role ID
groupID string QQ group ID
extraJson string extended field; the default is empty.Strictly case-sensitive. As for the format, please refer to:{"areaID":"1","partitionID":"1", "userZoneID": "The zone server where the user is located"}
Among them, areaID is required by QQ; in the test environment, it is needed to pass in the value agreed with IDIP through areaID; and in the release environment, it is needed to pass in a fixed value of 2 through areaID. WeChat does not need to pass in areaID. userZoneID is required by QQ; userZoneID must be passed in if the cross-zone group joining service is involved, and its value should be filled in with the zone server where the user is located.

4) Demo code

C#
C++
if (_mCurLoginChannel.Equals("QQ")) {
    string unionID = "1234";
    string zoneID = "5678";
    string roleID = "roleID";
    string groupID = "1234567890";
    string extraJson = "{\"areaID\":\"1\"}"; //areaID is required;in the test environment, it is needed to pass in the value agreed with IDIP through areaID; and in the release environment, it is needed to pass in a fixed value of 2 through areaID.
    MSDKGroup.JoinGroup(unionID, zoneID, roleID, groupID, extraJson);
} else if (_mCurLoginChannel.Equals("WeChat")) {
    string unionID = "unionID";
    MSDKGroup::JoinGroup(unionID);
}
if (mCurChannel == "QQ") {
    string groupID = "1234567890";
    string unionID = "1234";
    string zoneID = "5678";
    string roleID = "roleID";
    string extraJson = "{\"areaID\":\"1\"}"; //areaID is required;in the test environment, it is needed to pass in the value agreed with IDIP through areaID; and in the release environment, it is needed to pass in a fixed value of 2 through areaID.
    MSDKGroup::JoinGroup(unionID, zoneID, roleID, groupID, extraJson);
} else if (mCurChannel == "WeChat") {
    string unionID = "unionID";
    MSDKGroup::JoinGroup(unionID);
}

2.4 Get Group State

1) Function Description

View the state of the union binding the group.
① WeChat: only need to input the queried union information unionID
② QQ: need unionID and zoneID; query information about the state of the union binding the group Return information and result:
In the return code, 0 indicates not binding any group, 1 indicates that the union has bound a group.

2) Interface Declaration

C#
C++
public static void GetGroupState (string unionID, string zoneID = "", string extraJson = "")
static void GetGroupState (String unionID, String zoneID = "", String extraJson = "") ;

3) Parameter Description

Parameter Name Parameter Type Description
unionID string union ID.
QQ: A numeric value is required in the string, such as: "123456", and its length is <= 20;
WeChat: No requirement at the moment.
zoneID string game zone server ID
QQ: A numeric value is required in the string, such as: "5678".
extraJson string extended field; the default is empty.Strictly case-sensitive. As for the format, please refer to:{"areaID":"1"}

4) Demo code

C#
C++
if (_mCurLoginChannel.Equals("QQ")) {
    string unionID = "1234";
    string zoneID = "5678";
    MSDKGroup.GetGroupState(unionID, zoneID);
} else if (_mCurLoginChannel.Equals("WeChat")) {
    string unionID = "unionID";
    MSDKGroup.GetGroupState(unionID);
}
if (mCurChannel == "QQ") {
    string unionID = "1234";
    string zoneID = "5678";
    MSDKGroup::GetGroupState(unionID, zoneID);
} else if (mCurChannel == "WeChat") {
    string unionID = "unionID";
    MSDKGroup::GetGroupState(unionID);
}

2.5 Get Group Relations

1) Function Description

View the identity of the user in the specified group.
① WeChat: fill the unionID
② QQ: fill the specified groupID
Returned information and results are as follows:

channel return value
WeChat 3: group member ; 4: non-group member ; -1: query failure
QQ 1: group master; 2: administrator ; 3: common member ; 4: non-member ; -1: query error

2) Interface Declaration

C#
C++
public static void GetGroupRelation (string targetID, string extraJson = "")
static void GetGroupRelation (String targetID, String extraJson = "");

3) Parameter Description

Parameter Name Parameter Type Description
targetID string In case of WeChat, fill in union unionID; in case of QQ, fill in group number groupID
extraJson string extended field; the default is empty.Strictly case-sensitive. As for the format, please refer to:{"areaID":"1"}

4) Demo code

C#
C++
if (_mCurLoginChannel.Equals("QQ")) {
    string groupID = "groupID1234";
    MSDKGroup.getGroupRelation (groupID); 
} else if (_mCurLoginChannel.Equals("WeChat")) {
    string unionID = "unionID1234";
    MSDKGroup.GetGroupRelation (unionID); 
}
if (mCurChannel == "QQ") {
    string groupID = "QQGroupID1234"; 
    MSDKGroup:: GetGroupRelation (groupID); 
} else if (mCurChannel == "WeChat") {
    string unionID = "WeChatUnionID1234"; 
    MSDKGroup:: GetGroupRelation (unionID); 
}

2.6 Unbind Group

1) Function Description

Unbind the target group.
1) WeChat: only need to fill with unionID
2) QQ: fill with the previously recorded unionID, unionName, zoneID and roleID in order
Return information and result:
Return the return code about the information of unbinding the group successfully through querying getGroupState. If the return code shows that the union where the user does not bind any group, this can verify that the user unbinds group successfully.

2) Interface Declaration

C#
C++
public static void UnbindGroup (string unionID, string unionName = "", string zoneID = "", string roleID = "", string extraJson = "")
static void UnbindGroup (String unionID, String unionName = "", String zoneID = "", String roleID = "", String extraJson = "");

3) Parameter Description

Parameter Name Parameter Type Description
unionID string union ID.
QQ: A numeric value is required in the string, such as: "123456", and its length is <= 20;
WeChat: No requirement at the moment.
unionName string union name ID
zoneID string game zone server ID
QQ: A numeric value is required in the string, such as: "5678".
roleID string game role ID
extraJson string extended field; the default is empty.Strictly case-sensitive. As for the format, please refer to:{"areaID":"1"}.
Among them, areaID is required by QQ; in the test environment, it is needed to pass in the value agreed with IDIP through areaID; and in the release environment, it is needed to pass in a fixed value of 2 through areaID. WeChat does not need to pass in areaID.

4) Demo code

C#
C++
if (_mCurLoginChannel.Equals("QQ")) {
    string unionID = "1234";
    string unionName = "unionName";
    string zoneID = "5678";
    string roleID = "roleID";
    string extraJson = "{\"areaID\":\"1\"}"; //areaID is required;in the test environment, it is needed to pass in the value agreed with IDIP through areaID; and in the release environment, it is needed to pass in a fixed value of 2 through areaID.
    MSDKGroup.UnbindGroup(unionID, unionName, zoneID, roleID,extraJson);
} else if (_mCurLoginChannel.Equals("WeChat")) {
    string unionID = "unionID";
    MSDKGroup.UnbindGroup(unionID);
}
if (mCurChannel == "QQ") {
    string unionID = "1234";
    string unionName = "unionName";
    string zoneID = "5678";
    string roleID = "roleID";
    string extraJson = "{\"areaID\":\"1\"}"; //areaID is required;in the test environment, it is needed to pass in the value agreed with IDIP through areaID; and in the release environment, it is needed to pass in a fixed value of 2 through areaID.
    MSDKGroup::UnbindGroup(unionID, unionName , zoneID , roleID, extraJson);
} else if (mCurChannel == "WeChat") {
    string unionID = "unionID";
    MSDKGroup::UnbindGroup(unionID);
}

2.7 Remind the Union President to Build a Group (unique to QQ channel)

1) Function Description

QQ can remind the union president to build a group.
The union president pays attention to the "QQ mobile game" service number. After the system returns the function is implemented successfully, the union president receives the message in the service number.The frequency limit restricts that an account can receive one piece a day.

2) Interface Declaration

C#
C++
public static void RemindToBindGroup (string unionID, string zoneID, string roleID, string roleName, string leaderOpenID, string leaderRoleID, string extraJson = "")
static void RemindToBindGroup (String unionID, String zoneID, String roleID, String roleName, String leaderOpenID, String leaderRoleID, String extraJson = "");

3) Parameter Description

Parameter Name Parameter Type Description
unionID string union ID.
QQ: A numeric value is required in the string, such as: "123456", and its length is <= 20;
WeChat: No requirement at the moment.
zoneID string game zone server ID
QQ: A numeric value is required in the string, such as: "5678".
roleID string game role ID
roleName string game role name
leaderOpenID string union president openID
leaderRoleID string union president's role ID
extraJson string extended field; the default is empty.Strictly case-sensitive. As for the format, please refer to:{"areaID":"1"}.
Among them, areaID is required by QQ; in the test environment, it is needed to pass in the value agreed with IDIP through areaID; and in the release environment, it is needed to pass in a fixed value of 2 through areaID. WeChat does not need to pass in areaID.

4) Demo code

C#
C++
string unionID = "1234";
string zoneID = "5678";
string roleID = "roleID";
string roleName = "roleName";
string leaderOpenID = "leaderOpenID";
string leaderRoleID = "leaderRoleID";
string extraJson = "{\"areaID\":\"1\"}";/ //areaID is required;in the test environment, it is needed to pass in the value agreed with IDIP through areaID; and in the release environment, it is needed to pass in a fixed value of 2 through areaID.
MSDKGroup.RemindToBindGroup(unionID, zoneID, roleID, roleName, leaderOpenID, leaderRoleID extraJson);
string unionID = "1234";
string zoneID = "5678";
string roleID = "roleID";
string roleName = "roleName";
string leaderRoleID = "leaderRoleID";
string leaderOpenID = "leaderOpenID";
string extraJson = "{\"areaID\":\"1\"}"; //areaID is required;in the test environment, it is needed to pass in the value agreed with IDIP through areaID; and in the release environment, it is needed to pass in a fixed value of 2 through areaID.
MSDKGroup::RemindToBindGroup(unionID, zoneID, roleID, roleName, leaderOpenID, leaderRoleID, extraJson);

2.8 Bind A Group (unique to QQ channel)

1) Function Description

On QQ, the union president binds the existing QQ group, before this interface is called, it is needed to first call the GetGroupList() interface to draw the list of created groups.
Return information and result:
Return the return value information of binding group successfully. Through calling getGroupState, you can see that you have been bound to the group. This achieves verification.

2) Interface Declaration

C#
C++
public static void BindGroup (string unionID, string zoneID, string roleID, string groupID, string groupName, string extraJson = "")
static void BindGroup (String unionID, String zoneID, String roleID, String groupID, String groupName, String extraJson = "");

3) Parameter Description

Parameter Name Parameter Type Description
unionID string union ID.
QQ: A numeric value is required in the string, such as: "123456", and its length is <= 20;
WeChat: No requirement at the moment.
zoneID string game zone server ID
QQ: A numeric value is required in the string, such as: "5678".
roleID string game role ID
groupID string QQ group number, which is gotten when you create group
groupName string QQ group name, which is gotten when you create group
extraJson string extended field; the default is empty.Strictly case-sensitive. As for the format, please refer to:{"areaID":"1"}.
Among them, areaID is required by QQ; in the test environment, it is needed to pass in the value agreed with IDIP through areaID; and in the release environment, it is needed to pass in a fixed value of 2 through areaID. WeChat does not need to pass in areaID.

4) Demo code

C#
C++
string unionID = "1234";
string zoneID = "5678";
string roleID = "roleID";
string groupID = "1234567890";
string groupName = "groupName";
string extraJson = "{\"areaID\":\"1\"}"; //areaID is required;in the test environment, it is needed to pass in the value agreed with IDIP through areaID; and in the release environment, it is needed to pass in a fixed value of 2 through areaID.
MSDKGroup.BindGroup(unionID, zoneID, roleID, groupID, groupName, extraJson);
string groupID = "1234567890";
string groupName = "groupName";
string unionID = "1234";
string zoneID = "5678";
string roleID = "roleID";
string extraJson = "{\"areaID\":\"1\"}"; //areaID is required;in the test environment, it is needed to pass in the value agreed with IDIP through areaID; and in the release environment, it is needed to pass in a fixed value of 2 through areaID.
MSDKGroup::BindGroup(unionID, zoneID, roleID, groupID, groupName, extraJson);

2.9 Get the List of Groups Created by the Union President (unique to QQ channel)

1) Function Description

On QQ side, view the list of groups owned by the union president.
Return information:
GroupInfo in the return value records the list of groups owned by the union president, where each group record contains the groupID and groupName of the group

2) Interface Declaration

C#
C++
public static void GetGroupList ()
static void GetGroupList ();

3) Demo code

C#
C++
MSDKGroup.GetGroupList();
MSDKGroup::GetGroupList();

4) Data structure

MSDKGroupInfo explanation

member variable name type Description
GroupId string Required, groupid
GroupName string Required, group name
ExtraJson string Optional, extended field, other group information

2.10 Send Group Message (unique to WeChat channel)

1) Function Description

On WeChat side, send messages to the group chat. If the information is sent successfully, the message record can be seen on the WeChat side. A single user can send up to 100 pieces of messages per day in the same group.

2) Interface Declaration

C#
C++
public static void SendGroupMessage (MSDKGroupMessage groupMessage, string unionID)
static void SendGroupMessage (const MSDKGroupMessage &groupMessage, String unionID);

3) Parameter Description

Parameter Name Parameter Type Description
groupMessage MSDKGroupMessage group message
unionID string QQ channel: share the group_openid of the specified group
WeChat channel: share the union ID of the specified group

MSDKGroupMessage explanation

1、 QQ

Parameter Name Parameter Type Description
Title string required, the shared message's title
Desc string optional, the shared message's content
Link string required, the corresponding callback address of redirect_url (the callback address configured by an third-party app when the app is put on the shelf; That is: "callback address" filled in when applying for QQ group capability permission; it is not allowed to fill in any other domain name address)
ExtraJson string optional; extension field; transparently transmit image_url and param fields
image_url string optional, the URL of the thumbnail on the left of the message
param string optional, the number of input parameters of redirect_url; the third party can skip to different details pages according to this parameter (pass "" by default)

2、 WeChat

Parameter Name Parameter Type Description
Title string required, the shared message's title
Desc string optional, the shared message's content
Link string optional; redirect URL; required when Type = 2
ActionReport int required; share type, invite 1, show off 2, give away 3, ask for 4
ExtraJson string optional; extension field; transparently transmit messageExt and mediaTagName fields
messageExt string optional; the additional field of shared message
mediaTagName string optional; distinguish the game's message types; used for data statistics

4) Demo code

1、QQ

C#
C++
MSDKGroupMessage info = new MSDKGroupMessage();
info.Title = "title";
info.Link = "http://www.qq.com";
info.Desc = "desc";
info.ExtraJson = "{\"imageUrl\": \"https://avatars0.githubusercontent.com/u/3755338?s=460&amp;v=4\",\"param\": \"11\"}";

string ID = "group_openid";
MSDKGroup.SendGroupMessage(info, ID);
MSDKGroupMessage groupMessage;
groupMessage.Title = "title";
groupMessage.Link = "http://www.qq.com";
groupMessage.Desc = "desc";
groupMessage.ExtraJson = "{\"imageUrl\": \"https://avatars0.githubusercontent.com/u/3755338?s=460&amp;v=4\",\"param\": \"11\"}";

string ID = "group_openid";
MSDKGroup::SendGroupMessage(groupMessage, ID);

2、WeChat

C#
C++
MSDKGroupMessage info = new MSDKGroupMessage();
info.Title = "title";
info.Link = "https://game.weixin.qq.com/cgi-bin/act?noticeid=90103953&amp;actid=7006&amp;k=Q6EgQ_8DgubBRXGb1vmTBw&amp;q=0&amp;jsapi_ticket=1&amp;hongbaoid=8CF558E6633CCB020796260075B95465#wechat_redirect";
info.Desc = "desc";
info.Type = 1;
info.ActionReport = 1;
info.ExtraJson = "{\"messageExt\": \"test1\",\"mediaTagName \": \"test2\"}";

string ID = "Union ID";
MSDKGroup.SendGroupMessage(info, ID);
MSDKGroupMessage groupMessage;
groupMessage.Title = "title";
groupMessage.Link = "https://game.weixin.qq.com/cgi-bin/act?noticeid=90103953&amp;actid=7006&amp;k=Q6EgQ_8DgubBRXGb1vmTBw&amp;q=0&amp;jsapi_ticket=1&amp;hongbaoid=8CF558E6633CCB020796260075B95465#wechat_redirect";
groupMessage.Desc = "desc";
groupMessage.Type = 1;
groupMessage.ActionReport = 1;
groupMessage.ExtraJson = "{\"messageExt\": \"test1\",\"mediaTagName \": \"test2\"}";

string ID = "Union ID";
MSDKGroup::SendGroupMessage(groupMessage, ID);

III. FAQs

3.1 Detailed description of MSDKUnionInfo

Member variable name Type Description
unionID string Required; union id
unionName string Optional; union name
zoneID string Optional; the union's zone server id
userZoneID string Optional; the user's zone server id, which can be omitted if the user's zone server is the same as the union's zone server. Because the president may transfer the union's zone server id to someone not in the zone server, the union's zone server may not be same as the user's zone server
roleID string Optional; role id
roleName string Optional; role name, shown as the nickname in the group
leaderID string Optional; the union president's openid
leaderRoleID string Optional; the union president's role id
leaderZoneID string Optional; the president's zone server information, which can be omitted if the president's zone server is the same as the union's zone server. The president may transfer the union's zone server id to someone not in the zone server
type string Optional; 0 - union (or not filled in), 1 - team, 2 - competition event
areaID string Optional; the game's area ID, used in the test environment, theoretically only 1: QQ, 2: WeChat, but the test environment has a lot of virtual platfroms
partitionID string Optional; partition server id, temporarily not available
nickName string Optional; the player's nickname
extraJson string Optional, extension field

3.2 Precautions on the ability of QQ joining and binding groups:

(1)A uion ID can only be bound to one QQ group;

(2) The QQ group joining and binding platform uses AppID+zoneID+uion ID as the unique identifier. If the game side wants to combine two servers into one, it is needed to pay attention to the logic processing after the servers are combined, that is, the mapping processing of the player's zoneID before the servers are combined and the player's zoneID after the servers are combined. If a guild was created in the 101 partition before the servers are combined, no matter which partition the user is in later on, the partition ID of the 101 partition shall be transmitted;

(3) If the user disbands the guild's QQ group, the guild and the guild's QQ group will not be automatically unbound. You can cancel the binding relationship by the following methods. If you have not performed any of the following operations, the binding relationship will not disappear automatically :

  • The guild president calls the unbinding interface to dissolve the group relationship;
  • When a guild member calls the group- joining interface, the group ID cannot be queried at this time, and the binding relationship will be unbound by default;

(4) After the guild president transfers the group to another guild, the new guild president can also perform unbinding operations;

(5) areaID needs to be passed in the extraJson field. It is strictly case-sensitive. In the test environment, it is only needed to pass in the value agreed with IDIP. In the formal environment, it is needed to pass in 2;

3.3 Error code

(1) QQ group function's return code;
(2) WeChat group function's return code.



Copyright © 2024 MSDK.
All rights reserved.

results matching ""

    No results matching ""