查询工会是否绑定群
查询公会是否绑定群
通过调用Tencent类的checkBindGroup调用查询公会是否绑定群接口
API格式:
checkBindGroup(Context context, Bundle params, IUiListener listener)
参数1 Context: 上下文
参数2 Bundle:外部传递参数
| 参数 | 是否必填 | 类型 | 参数说明 |
|---|---|---|---|
| GameAppOperation.GAME_GUILD_ID | 是 | String | 公会ID |
| GameAppOperation.GAME_GUILD_ZONE_ID | 是 | String | 游戏区域ID |
| GameAppOperation.GAME_ROLE_ID | 是 | String | 游戏角色ID |
参数3 IUiListener 回调实例。 成功:返回码为0并且群号不为空。
调用接口的示例代码如下:
mTencent = Tencent.createInstance(APPID, this);
Bundle params = new Bundle();
params.putString(GameAppOperation.GAME_GUILD_ID, guild_id.getText());
params.putString(GameAppOperation.GAME_GUILD_ZONE_ID , zone_id.getText());
pparams.putString(GameAppOperation.GAME_ROLE_ID, role_id.getText())
IUiListener listener = new IUiListener() {
@Override
public void onComplete(Object response) {
Util.toastMessage(this, “onComplete:” + response.toString());
JSONObject jsonObject = (JSONObject )response;
try{
String retMsg = jsonObject.get(“retMsg”);
String retCode = jsonObject.get(“retCode”);
String groupCode = jsonObject.get(“gc”);
String groupName = jsonObject.get(“group_name”);
//todo 根据返回码处理
}catch (JSONException e) {
e.printStackTrace();
}
}
@Override
public void onCancel() {
Util.toastMessage(this, “onCancel ” );
}
@Override
public void onError(UiError e) {
Util.toastMessage(this, “onError:” + e.errorMessage, “e”);
}
}
mTencent.checkBindGroup(this, params,listener);
注意:CGI调用需要登录态!!!
