Java Code Examples for com.tencent.mm.sdk.modelmsg.SendAuth#Resp

The following examples show how to use com.tencent.mm.sdk.modelmsg.SendAuth#Resp . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: WXEntryActivity.java    From Gizwits-SmartBuld_Android with MIT License 6 votes vote down vote up
@Override
public void onResp(BaseResp resp) {
	Log.e(TAG, "onResp...");
	Log.i("Apptest", "onResp...");
	String code = null;
	switch (resp.errCode) {
	case BaseResp.ErrCode.ERR_OK:// 用户同意,只有这种情况的时候code是有效的
		code = ((SendAuth.Resp) resp).code;
		Log.i("Apptest", code);
		getResult(code);
		break;
	case BaseResp.ErrCode.ERR_AUTH_DENIED:// 用户拒绝授权
		Log.e("Apptest", "用户拒绝授权");
		break;
	case BaseResp.ErrCode.ERR_USER_CANCEL:// 用户取消
		Log.e("Apptest", "用户取消");
		break;

	default:// 发送返回

		break;
	}
	finish();
}
 
Example 2
Source File: WXEntryActivity.java    From gokit-android with MIT License 6 votes vote down vote up
@Override
public void onResp(BaseResp resp) {
	Log.e(TAG, "onResp...");
	Log.i("Apptest", "onResp...");
	String code = null;
	switch (resp.errCode) {
	case BaseResp.ErrCode.ERR_OK:// 用户同意,只有这种情况的时候code是有效的
		code = ((SendAuth.Resp) resp).code;
		Log.i("Apptest", code);
		getResult(code);
		break;
	case BaseResp.ErrCode.ERR_AUTH_DENIED:// 用户拒绝授权
		Log.e("Apptest", "用户拒绝授权");
		break;
	case BaseResp.ErrCode.ERR_USER_CANCEL:// 用户取消
		Log.e("Apptest", "用户取消");
		break;

	default:// 发送返回

		break;
	}
	finish();
}
 
Example 3
Source File: WXEntryActivity.java    From GOpenSource_AppKit_Android_AS with MIT License 5 votes vote down vote up
@Override
public void onResp(BaseResp resp) {
	Log.e(TAG, "onResp...");
	Log.i("Apptest", "onResp...");
	SDKLog.d(TAG + "   onResp...");
	String code = null;
	switch (resp.errCode) {
	case BaseResp.ErrCode.ERR_OK:// 用户同意,只有这种情况的时候code是有效的
		code = ((SendAuth.Resp) resp).code;
		Log.i("Apptest", code);

		SDKLog.d(TAG + "   code..." + code);
		getResult(code);
		break;
	case BaseResp.ErrCode.ERR_AUTH_DENIED:// 用户拒绝授权
		Log.e("Apptest", "用户拒绝授权");
		SDKLog.d(TAG + "   用户拒绝授权...");
		break;
	case BaseResp.ErrCode.ERR_USER_CANCEL:// 用户取消
		Log.e("Apptest", "用户取消");
		SDKLog.d(TAG + "   用户取消...");
		break;

	default:// 发送返回

		break;
	}
	finish();
}
 
Example 4
Source File: WeChatSSOProxy.java    From ESSocialSDK with Apache License 2.0 5 votes vote down vote up
public static void authComplete(SendAuth.Resp resp) {

        switch (resp.errCode) {
            case BaseResp.ErrCode.ERR_OK:
                callback.onGetCodeSuccess(resp.code);
                break;
            case BaseResp.ErrCode.ERR_USER_CANCEL:
                callback.onCancel();
                break;
            case BaseResp.ErrCode.ERR_AUTH_DENIED:
                callback.onFailure(new Exception("BaseResp.ErrCode.ERR_AUTH_DENIED"));
                break;
        }
    }
 
Example 5
Source File: WXCallbackActivity.java    From ESSocialSDK with Apache License 2.0 5 votes vote down vote up
@Override
public void onResp(BaseResp resp) {
    if (resp instanceof SendAuth.Resp)
        WeChatSSOProxy.authComplete((SendAuth.Resp) resp);
    else if (resp instanceof SendMessageToWX.Resp)
        WeChatShareProxy.shareComplete((SendMessageToWX.Resp) resp);

    finish();
}