1
我這篇文章如下:Ionic Push Notification Guide離子不離子定義v2的推送通知
但這樣做的所有步驟後,我一直在的app.js
的下一行得到一個「離子沒有定義」我離子應用:
var push = new Ionic.Push({
"debug": true
});
我不知道爲什麼會這樣,但是這是我的angular.module.run
功能齊全的在這個問題上更深入的瞭解:
.run(function($ionicPlatform) {
$ionicPlatform.ready(function() {
if (window.cordova && window.cordova.plugins.Keyboard) {
cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
cordova.plugins.Keyboard.disableScroll(true);
}
if (window.StatusBar) {
StatusBar.styleDefault();
}
var push = new Ionic.Push({
"debug": true
});
push.register(function(token) {
console.log("My Device token:",token.token);
push.saveToken(token);
});
});
})
請告訴我任何額外的信息,我可以提供使這個問題更清楚。