解除绑群
解绑群
通过调用Tencent类的unBindGroup调用解绑群接口
API格式:
unBindGroup(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: 成功
221002: 未绑定群
221005: 当前用户不是群主
调用接口的示例代码如下:
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());
params.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.getString(“retMsg”);
int retCode = jsonObject.getInt(“retCode”);
//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.unBindGroup(this, params,listener);注意:CGI调用需要登录态!!!
