Sharing and email sharing
Use plug-ins
Cordova plugin add cordova-plugin-wechat -- variable wechatappid = YOUR_WECHAT_APPID;
$ Scope. WeChat chat = function (scene, title, desc, url, thumb ){
// Console. log (scene );
Wechat. share ({
Message :{
Title: "What You Don't Know ",
Description: "This is description ",
Thumb: "http://pic6.huitu.com/res/20130116/84481_20130116142820494200_1.jpg ",
// Url: url? Url: http://baidu.com"
Media :{
Type: Wechat. Type. WEBPAGE,
WebpageUrl: "http://www.cnblogs.com/gongdy"
}
},
Scene: scene // share to Timeline
}, Function (){
Alert ("Success ");
}, Function (reason ){
Alert ("Failed:" + reason );
});
};
$ Scope. shareLink = function (title, desc, url, thumb ){
Var hideSheet = $ ionicActionSheet. show ({
Buttons :[{
'Text': 'share with friends '},
{'Text': 'share to your friends'}],
CancelText: 'cancel ',
ButtonClicked: function (index ){
If (index = 0 ){
$ Scope. WeChat chat (0, title, desc, url, thumb );
} Else if (index = 1 ){
$ Scope. WeChat chat (1, title, desc, url, thumb );
}
// Return true;
}
});
$ Timeout (function (){
HideSheet ();
},2000 );
};