Skip to content
jackie edited this page Nov 26, 2015 · 6 revisions

General

What's the difference between cordova-plugin-wechat and SocialSharing-PhoneGap-Plugin?

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.

Rejected by Apple app store claiming we should provide ways to allow people to authenticate/login 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)

Installation

TypeError: Cannot convert undefined or null to object

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.

Sharing

After sharing, it doesn't return back to my app.

(iOS)Please make sure the URL Type is correct. (Android) Your app signature is correct.

Payment

How could I generate all the parameters required in payment request?

Here is a php demo for that.

Clone this wiki locally