AI助手支持GPT4.0
微信分享的时候发现提示签名不对,请检查与开放平台是否一致。怎么弄都不行?When sharing on WeChat, it is found that the signature is incorrect. Please check whether it is consistent with the open platform. How can't I do it?
微信分享的时候发现提示签名不对,请检查与开放平台是否一致。怎么弄都不行?
AppID:wxfaa34534bffce6fb
应用签名:c0907c0077a52cd88764a79596c0b334
包名:com.hongju.yst
我只做微信分享功能,下载了范例代码,直接拷过来分享代码的,但是无论如何调试都是签名出错,快折磨死了。
api = WXAPIFactory.createWXAPI(this, Constants.APP_ID, false);api.registerApp(Constants.APP_ID);WXWebpageObject webpage = new WXWebpageObject();webpage.webpageUrl = "http://www.XXX.com";WXMediaMessage msg = new WXMediaMessage(webpage);msg.title = "XXX";msg.description = "XXX";Bitmap bmp = BitmapFactory.decodeResource(getResources(), R.drawable.ic_launcher_min);Bitmap thumbBmp = Bitmap.createScaledBitmap(bmp, 150, 150, true);bmp.recycle();msg.thumbData = Util.bmpToByteArray(thumbBmp, true);SendMessageToWX.Req req = new SendMessageToWX.Req();req.transaction = buildTransaction("webpage");req.message = msg;req.scene = SendMessageToWX.Req.WXSceneSession;req.openId="wxfaa34534bffce6fb";api.sendReq(req);
Appid: wxfaa34534bffce6fb application signature: c0907c0077a52cd88764a79596c0b334 package name: com.hongju.yst I only do wechat sharing function. I downloaded the sample code and copied it to share the code directly. However, no matter how I debug it, it's a signature error, which is killing me. api = WXAPIFactory.createWXAPI (this, Constants.APP_ ID, false); api.registerApp ( Constants.APP_ ID);WXWebpageObject webpage = new WXWebpageObject(); webpage.webpageUrl = " http://www.XXX.com ";WXMediaMessage msg = new WXMediaMessage(webpage); msg.title = "XXX"; msg.description = "XXX";Bitmap bmp = BitmapFactory.decodeResource (getResources(), R. drawable.ic_ launcher_ min);Bitmap thumbBmp = Bitmap.createScaledBitmap (bmp, 150, 150, true); bmp.recycle (); msg.thumbData = Util.bmpToByteArray (thumbBmp, true); SendMessageToWX.Req req = new SendMessageToWX.Req (); req.transaction = buildTransaction("webpage"); req.message = msg; req.scene = SendMessageToWX.Req.WXSceneSession ; req.openId= "wxfaa34534bffce6fb"; api.sendReq (req);
晕,折腾了一天,然后我重启了下手机,正常了!!!!