meteor 實現 微信分享

石橋碼農發表於2015-08-20
  Template.hello.events({
    'click button': function () {
      // increment the counter when button is clicked
      Session.set('counter', Session.get('counter') + 1);

        var imgData = "不帶描述頭的base64圖片資料";
        WeChat
            .share({
                title: '連結111111',
                description: '連結描述1111',
                url: 'http://www.lawxin.com',
                thumbData:imgData
            }, WeChat.Scene.timeline, function () {
                alert('分享成功~');
            }, function (reason) {
                // 分享失敗
                alert(reason);
            });
    }
  });

  

meteor add cordova:com.wordsbaking.cordova.wechat@https://github.com/vilic/cordova-plugin-wechat/tarball/76bfa31de051f44d3835d05b6cc51331e48e604c

 

enjoy!

相關文章