本文整理汇总了Java中com.tencent.mm.opensdk.modelbase.BaseReq类的典型用法代码示例。如果您正苦于以下问题:Java BaseReq类的具体用法?Java BaseReq怎么用?Java BaseReq使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
BaseReq类属于com.tencent.mm.opensdk.modelbase包,在下文中一共展示了BaseReq类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: share
import com.tencent.mm.opensdk.modelbase.BaseReq; //导入依赖的package包/类
@Override
public void share(@NonNull final ShareData data, @NonNull final OnCallback<String> callback) {
if (!mApi.isWXAppInstalled()) {
callback.onFailed(mActivity, ResultCode.RESULT_FAILED, "您未安装微信!");
return;
}
mCallback = callback;
new AsyncTask<ShareData, Void, BaseReq>() {
@Override
protected BaseReq doInBackground(ShareData... params) {
return makeReq(params[0]);
}
@Override
protected void onPostExecute(BaseReq req) {
mCallback.onStarted(mActivity);
mApi.sendReq(req);
}
}.execute(data);
}
示例2: handleResult
import com.tencent.mm.opensdk.modelbase.BaseReq; //导入依赖的package包/类
@Override
public void handleResult(Intent data) {
mIWXAPI.handleIntent(data, new IWXAPIEventHandler() {
@Override
public void onReq(BaseReq baseReq) {
}
@Override
public void onResp(BaseResp baseResp) {
switch (baseResp.errCode) {
case BaseResp.ErrCode.ERR_OK:
ShareUtil.mShareListener.shareSuccess();
break;
case BaseResp.ErrCode.ERR_USER_CANCEL:
ShareUtil.mShareListener.shareCancel();
break;
default:
ShareUtil.mShareListener.shareFailure(new Exception(baseResp.errStr));
}
}
});
}
示例3: WXHandler
import com.tencent.mm.opensdk.modelbase.BaseReq; //导入依赖的package包/类
public WXHandler() {
this.mEventHandler = new IWXAPIEventHandler() {
public void onResp(BaseResp resp) {
if(!mLastTransaction.equals(resp.transaction)) {
return;
}
int type = resp.getType();
switch(type) {
case ConstantsAPI.COMMAND_SENDAUTH: //授权返回
WXHandler.this.onAuthCallback((SendAuth.Resp)resp);
break;
case ConstantsAPI.COMMAND_SENDMESSAGE_TO_WX: //分享返回
WXHandler.this.onShareCallback((SendMessageToWX.Resp)resp);
break;
}
}
public void onReq(BaseReq req) {
}
};
}
示例4: onReq
import com.tencent.mm.opensdk.modelbase.BaseReq; //导入依赖的package包/类
@Override
public void onReq(BaseReq req) {
switch (req.getType()) {
case ConstantsAPI.COMMAND_GETMESSAGE_FROM_WX:
// goToGetMsg();
break;
case ConstantsAPI.COMMAND_SHOWMESSAGE_FROM_WX:
// goToShowMsg((ShowMessageFromWX.Req) req);
break;
default:
break;
}
Toast.makeText(this, req.openId, Toast.LENGTH_LONG).show();
}
示例5: run
import com.tencent.mm.opensdk.modelbase.BaseReq; //导入依赖的package包/类
@Override
public void run() {
if (mAction.getPayType() == Pay.PayType.APIPAY) {
PayTask payTask = new PayTask(mPay.getContext());
String mapToParameters = Utils.getMapToParameters(mPayInfo.getOrderInfo(Map.class));
Map<String, String> result = payTask.payV2(mapToParameters, false);
PayResult payResult = new PayResult(result);
if (TextUtils.equals(payResult.getResultStatus(), "9000")) {
mDispatcher.dispatchResult(Dispatcher.SUCCESS, this);
} else {
mDispatcher.dispatchResult(Dispatcher.FAILED, this);
}
} else if (mAction.getPayType() == Pay.PayType.WECHAT) {
PayReq payReq = mPayInfo.getOrderInfo(PayReq.class);
IWXAPI msgApi = WXAPIFactory.createWXAPI(mPay.getContext(), null);
msgApi.registerApp(payReq.appId);
msgApi.handleIntent(mPay.getContext().getIntent(), new IWXAPIEventHandler() {
@Override
public void onReq(BaseReq baseReq) {
}
@Override
public void onResp(BaseResp baseResp) {
}
});
}
}
示例6: handleResult
import com.tencent.mm.opensdk.modelbase.BaseReq; //导入依赖的package包/类
@Override
public void handleResult(int requestCode, int resultCode, Intent data) {
mIWXAPI.handleIntent(data, new IWXAPIEventHandler() {
@Override
public void onReq(BaseReq baseReq) {
}
@Override
public void onResp(BaseResp baseResp) {
if (baseResp instanceof SendAuth.Resp && baseResp.getType() == 1) {
SendAuth.Resp resp = (SendAuth.Resp) baseResp;
switch (resp.errCode) {
case BaseResp.ErrCode.ERR_OK:
getToken(resp.code);
break;
case BaseResp.ErrCode.ERR_USER_CANCEL:
mLoginListener.loginCancel();
break;
case BaseResp.ErrCode.ERR_SENT_FAILED:
mLoginListener.loginFailure(new Exception(INFO.WX_ERR_SENT_FAILED));
break;
case BaseResp.ErrCode.ERR_UNSUPPORT:
mLoginListener.loginFailure(new Exception(INFO.WX_ERR_UNSUPPORT));
break;
case BaseResp.ErrCode.ERR_AUTH_DENIED:
mLoginListener.loginFailure(new Exception(INFO.WX_ERR_AUTH_DENIED));
break;
default:
mLoginListener.loginFailure(new Exception(INFO.WX_ERR_AUTH_ERROR));
}
}
}
});
}
示例7: onReq
import com.tencent.mm.opensdk.modelbase.BaseReq; //导入依赖的package包/类
public void onReq(BaseReq req) {
if(this.mWXHandler != null) {
this.mWXHandler.getWXEventHandler().onReq(req);
}
this.finish();
}
示例8: onReq
import com.tencent.mm.opensdk.modelbase.BaseReq; //导入依赖的package包/类
@Override
public void onReq(BaseReq baseReq) {
Log.d(TAG, "onReq");
if (isAutoFinishAfterOnReq()) {
finish();
}
}
示例9: onReq
import com.tencent.mm.opensdk.modelbase.BaseReq; //导入依赖的package包/类
@Override
public void onReq(BaseReq req) {
Log.e(TAG, "transaction = " + req.transaction + ", type = " + req.getType() + ", openId = " + req.openId);
}
示例10: onReq
import com.tencent.mm.opensdk.modelbase.BaseReq; //导入依赖的package包/类
@Override
public void onReq(BaseReq baseReq) {
}
示例11: onReq
import com.tencent.mm.opensdk.modelbase.BaseReq; //导入依赖的package包/类
@Override
public void onReq(BaseReq req) {
}
示例12: onReq
import com.tencent.mm.opensdk.modelbase.BaseReq; //导入依赖的package包/类
@Override
public void onReq(BaseReq baseReq) {
// 发起微信请求将会经过的方法
LogUtils.e(TAG, "onReq: " + baseReq.toString());
}
示例13: onReq
import com.tencent.mm.opensdk.modelbase.BaseReq; //导入依赖的package包/类
@Override
public void onReq(BaseReq req) {
finish();
}
示例14: onReq
import com.tencent.mm.opensdk.modelbase.BaseReq; //导入依赖的package包/类
@Override
public void onReq(BaseReq req) {
LogUtil.e("微信:onReq");
}
示例15: onReq
import com.tencent.mm.opensdk.modelbase.BaseReq; //导入依赖的package包/类
@Override
public void onReq(BaseReq baseReq) {
// no-op
}