【发布时间】:2016-09-27 16:55:01
【问题描述】:
我在关注这篇文章:Ionic Push Notification Guide
但在完成所有步骤后,我的 ionic 应用程序的 app.js 的下一行中不断出现“Ionic is not defined”:
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);
});
});
})
请告诉我我可以提供的任何其他信息,以使这个问题更清楚。
【问题讨论】:
标签: angularjs ionic-framework push-notification ionic2