WeChat android api
Asked Answered
C

4

4

I am trying to make an Android app which communicates with WeChat app.

Followed the sample from here

But in the sample and in my own app I am able to make api calls, which is being done. For example api.sendResp(resp) results to true.

But nothing happens, while authorising I still get null token from SendAuth.Resp.

Has anyone faced this problem?

Cundiff answered 29/11, 2013 at 11:29 Comment(2)
Also check this solution: #24670446Ppi
Possible duplicate of Getting Started with the WeChat Android SDKBanting
R
4

Two things to check:

  1. is the package signature right?
  2. did the app approved?(before approved you cannot publish anything)

make sure those and you'll get it work.

good luck.

Ridenhour answered 13/3, 2014 at 19:21 Comment(5)
have u any working example with wechat api integration ?Libbielibbna
How to confirm that my app got approved?Baucom
@Baucom an email will deliver to you after approved. Cheers.Ridenhour
@MengWang I'm stucked. What should I do for the package signature? Which is the linux command to get it?Easel
@Easel there are two easy ways you can get the signature: 1. use keyhole :"$ keytool -list -alias androiddebugkey -keystore <path_to_debug_keystore>.keystore \ -storepass android -keypass android" 2. download an app to your phone to get it, the app name is "CheckSignature". Have fun...Ridenhour
P
3

There's much more to check than just the package signature when trying to send a message to WeChat. Below is a list of issues I found while integrating with WeChat that cause the same issue you're having:

  1. WeChat seems to break if your package name differs from your applicationId. This is probably due to the reflection used by WeChat to respond to your request. If your package name differs from what's set in WeChat, you'll transition to WeChat when an auth attempt is made but you'll never get a response. If your applicationID differs from what's in WeChat, nothing at all will happen when you request an authorization. Basically you must not use applicationId.
  2. Package name can be mixed case but what's saved in WeChat must exactly match what's in your application.
  3. The Signature hash should only be alpha numeric. Do no include other symbols like ":". Use the MD5 signature.
  4. You must have a validated WeChat app on the device (use a real phone).
  5. You must use the proper project structure. If your package name is com.test.app, you must place your activity for handling WeChat responses at com.test.app.wxapi.WXEntryActivity.
  6. You must register before attempting to get a token.
  7. Be careful with minified code (Proguard). There are articles online that mention minified code can mess up WeChat communication.
  8. You must export your WXEntryActivity in your manifest.

Working example with successful SendAuth.Resp

Possibly answered 28/4, 2016 at 17:2 Comment(0)
L
0

I have tried to implement the integration of WeChat on Meteor before. The difficulty lies in getting the correct signature to apply for the WeChat App ID. I follow the tutorials and get my app work here: http://blog.sanuker.com/?p=691 Hope it helps! Good luck.

Lemaster answered 25/1, 2016 at 5:25 Comment(0)
I
0

After Searching a lot, finally got answer as Eric suggest login to weixin.qq.com site

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

download we chat apk from this link and generate signature from this apk, and submit on site.

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

Implausibility answered 8/6, 2016 at 7:21 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.