ionic微信分享提示: Failed:未知错误

cordova plugin add https://github.com/wowgeeker/cordova-plugin-wechat --variable wechatappid=wx7b22a8079fcd2f45

微信申请开放平台时有个应用签名,我的问题是填写错误所以提示失败
如果不知道应用签名的话,可以输入

 keytool -list -v -keystore [you key name].keystore
// 按提示输入keystore密码,证书指纹MD5 就是签名了,去掉冒号

也可以进入网站下载app,输入包名即可查询的签名

https://github.com/vilic/cordova-plugin-wechat/wiki/Android-%E5%BE%AE%E4%BF%A1-SDK-%E7%AD%BE%E5%90%8D%E9%97%AE%E9%A2%98

分享一下代码

 $scope.shareClick = function () {

      $ionicActionSheet.show({
        buttons: [{
            text: '分享至微信朋友圈',
          },
          {
            text: '分享至微信好友',
          }
        ],
        titleText: '分享',
        cancelText: '取消',
        cancel: function (res1) {
          console.log('取消分享')
        },
        buttonClicked: function (index, value) {
          if (index === 0) {
            $scope.shareApp(1);
          } else {
            $scope.shareApp(0);
          }
          return true;
        }
      });
    }

    $scope.shareApp = function(scene){
      Wechat.share({
        message: {
            title: "title",      // 标题
            description: "This is description.",    // 详情
            thumb: "***.png",    // 图片地址
            media: {
                type: Wechat.Type.WEBPAGE,
                webpageUrl: "www.baidu.com"      // 要分享的地址
            }
        },
        scene: scene  // share to Timeline
    }, function () {
        alert("Success");
    }, function (reason) {
        alert("Failed: " + reason);
    });
    }

你可能感兴趣的:(ionic微信分享提示: Failed:未知错误)