微信分享的时候发现提示签名不对,请检查与开放平台是否一致。怎么弄都不行?

小程序 文章 2020-08-07 16:21 2393 0 全屏看文

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);

回答:

风雨无阻:

晕,折腾了一天,然后我重启了下手机,正常了!!!!

Admin²⁰²⁰:

范例代码里面的包名appid修改成自己的了吗?检查下看哪里没有改掉哈。

风雨无阻:刚用魅族的安卓7.1手机试是可以的,我华为mate10安卓10就报这个
Admin²⁰²⁰:是不是你华为上运行的是AS的调试版本的app,签名用的是临时的导致的呢。
风雨无阻:我自查的截图都发出来了,有问题吗

-EOF-

AI助手支持GPT4.0