Share Moments Using Wechat API on Android

I created an application with the Wechat API. I am trying to post to a userโ€™s wall. I can publish moments on Wechat successfully on iOS (with a notification that the application has not yet been approved). However, nothing happened on Android.

Here is my code:

private IWXAPI api; api = WXAPIFactory.createWXAPI(this, Constants.WECHAT_APP_ID); api.registerApp(Constants.WECHAT_APP_ID); String text = "Post on Wechat Wall"; WXTextObject textObj = new WXTextObject(); textObj.text = text; WXMediaMessage msg = new WXMediaMessage(); msg.mediaObject = textObj; msg.description = text; boolean isChecked = false; // true SendMessageToWX.Req req = new SendMessageToWX.Req(); req.transaction = buildTransaction("text"); req.message = msg; req.scene = isChecked ? SendMessageToWX.Req.WXSceneTimeline : SendMessageToWX.Req.WXSceneSession; api.sendReq(req); finish(); 

ps: Wechat has not yet approved the application (it was sent 1 month ago). Maybe this is one of the reasons?

+1
android api wechat
source share
2 answers

The problem was not in my code, but on the platform on which I posted it.

I sent dev.wechat.com (English version of the developer platform), even if the documents look / have been updated to this day, there is no SDK for iOS and Android. And your presentation will never be considered (5 months after there are no signs of activity in the materials yet).

Decision:

Create an account on the Chinese version of the developer platform ( open.weixin.qq.com , then send your application to it. These are exactly the same fields and order as the English platform. Google translate will be your best friend here.

I received my application after three business days.

+1
source share

After searching a lot, I finally got an answer on how Eric would suggest entering weixin.qq.com

here you need to send 2 things, application package name and signature, the signature is not sha1 or md 5

Download, we communicate with this link and create a signature from this apk and send it to the site.

https://open.weixin.qq.com/cgi-bin/showdocument?action=dir_list&t=resource/res_list&verify=1&id=open1419319167&token=&lang=zh_CN

0
source share

All Articles