-
Notifications
You must be signed in to change notification settings - Fork 508
cordova-plugin-wechat uses the official wechat sdk, and SocialSharing-PhoneGap-Plugin does not. It uses the OS's default sharing feature (Intent on android, and UIActivityViewController on iOS) instead.
The benefit of using an official sdk is that we will have all the features provided by the official sdk, such as authentication, payment, analytics, and much more. Compared with using OS's default sharing feature, it loses the flexibility of sharing on other platforms, such as weibo, facebook, twitter, etc.
After installing the plugin, an error happened as follows:
Saving plugin to package.json file
Error happened [TypeError: Cannot convert undefined or null to object]
TypeError: Cannot convert undefined or null to object
at Function.keys (native)
at Object.getPluginFromFetchJsonByLocator (/usr/local/lib/node_modules/ionic/node_modules/ionic-app-lib/lib/state.js:734:26)
...
It was caused by package.json. You can find out which plugin is causing this issue by adding console.log(lookupPlugin); in the for loop in /usr/local/lib/node_modules/ionic/node_modules/ionic-app-lib/lib/state.js at line 730. Then, reinstall that plugin will solve the issue.
See CB7781.
For android, yes. For iOS, no.
(iOS)Please make sure the URL Type is correct. (Android) Your app signature is correct.
Here is a php demo for that.
You can replace the libammsdk.jar with libammsdk_debug.jar, and find the debugging messages in logcat. For example:
# assume you are at your project's root folder
cp plugins/xu.li.cordova.wechat/src/android/libammsdk_debug.jar platforms/android/libs/libammsdk.jar
adb logcat | grep 'MicroMsg.SDK'
Change Enable bitcode to No. See http://stackoverflow.com/questions/30848208/new-warnings-in-ios9.
Rejected by Apple app store claiming we should provide ways to allow people to authenticate/# with WeChat for people without installing the WeChat app.
You can hide the Wechat Login button if the wechat app is not installed.
$scope.showWechatLogin = false;
if (typeof Wechat !== 'undefined') {
Wechat.isInstalled(function (installed) {
if (installed) {
// Only show wechat login button if the Wechat App was detected
$scope.showWechatLogin = true;
}
}, function (reason) {
});
}
(Thanks @winsonchan and @Jeff-Tian)