xu-li / cordova-plugin-wechat

A cordova plugin, a JS version of Wechat SDK
1.22k stars 509 forks source link

[Android] Post in timeline dialog shows and disappear #17

Closed rlisperguier closed 9 years ago

rlisperguier commented 9 years ago

Hi,

I'm trying to implement this plugin on my app. In iOS works fine, but in android the share doesn't works, the dialog shows up but almost instantly closes and back to the app.

I don't know if i need to have the app approved in the devcenter (i created the app here: http://dev.wechat.com/)

The environment information is:

Device: HTC One m7, Android 4.4.2 Wechat: the last version on playstore

I appreciate some guide on this topic,

Thanks in advice

xu-li commented 9 years ago

@rlisperguier Yes, you have to have your app approved by wechat, and also don't forget to setup the callback(See below).

Note: Install(Android) Inspired by https://github.com/vilic/cordova-plugin-wechat Wechat needs to callback to "your.package.name.wxapi.WXEntryActivity" to handle response. Since the package name is determined when you install the packag.java, so we use hook to call android-install.js to do the work. I found some older version of cordova(ionic 1.3.0) doesn't trigger this js, so if you found this file isn't copied, consider upgrade Cordova.

rlisperguier commented 9 years ago

@xu-li thanks for the reply, i have the app approved in wechat, but i'm still getting this issue, can you give me some guide over the "note" section? i'm ussing phonegap build in the last version (3.7.0) i don't know if this is a problem (i also try compile locally with cordova, getting the same results)

rlisperguier commented 9 years ago

@xu-li i have already solved this problem. When i run cordova build android the activity WXEntryActivity wasn't copied to the corresponding folder, generating an app crash after share a link, so i copied manually the activity from the plugin folder to the platform folder and works. But it still not working with PhoneGapBuild

Thanks for your help

xu-li commented 9 years ago

@rlisperguier It should be okay now.