友盟推送cordova插件
ionic cordova plugin add cordova-plugin-umengpush --variable UM_APPKEY=YOUR_UM_APPKEY --variable UM_MESSAGE_SECRET=YOUR_UM_MESSAGE_SECRET
cordova.plugins.UMengPush.coolMethod("测试数据", function (res) {
alert(JSON.stringify(res));
}, function (err) {
alert(JSON.stringify(err));
})
npm i ionic-umengpush --save
providers: [
...
UMengPush,
...
]
constructor(public navCtrl: NavController,
public umengpush: UMengPush) {
init()
}
init(){
this.umengpush.setAlias("xxx").then(result => {
alert(JSON.stringify(result))
console.log("================")
console.log(JSON.stringify(result));
}).catch(err=>{
alert(JSON.stringify(err));
});
}