我是新来的:D
我有下面的代码:
alert('hi');
$cordovaPush.register(config).then(function (result) {
alert('push' + result);
}, function (err) {
alert('error);
});
alert('bye');当我转到Ionic View时,我会收到警告:“嗨”和“再见”,但从来没有“推”或“错误”…
我安装:
ionic plugin add https://github.com/phonegap-build/PushPlugin我把ng-cordova.js和PushNotification.js放入索引...
发生了什么?
谢谢!
发布于 2016-02-28 01:24:07
查看ngCordova插件对你来说很简单。例如:
var androidConfig = {
"senderID": "xxxxxxxxxxxx",
};
$ionicPlatform.ready(function() {
$cordovaPush.register(androidConfig).then(function(result) {
console.log(result);
}, function(err) {
console.log(err);
})
});以上代码添加到app.js文件中。这是最好的运气。
发布于 2016-02-28 02:27:48
我认为你的代码不正确
如下所示检查错误
alert('hi');
$cordovaPush.register(config)
.then(function (result) {
alert('push' + result);
})
.fail(function (err){
alert(err);
})
alert('bye');https://stackoverflow.com/questions/35671955
复制相似问题