离子设置推 - 无法读取未定义的属性

时间:2015-07-30 09:40:29

标签: cordova ionic ionic-view

我正在通过离子工作推送应用程序。我从离子本身跟随本教程:http://docs.ionic.io/docs/push-from-scratch

注册用户 - 完美的作品! 设置推送通知不是

它实际上在两周前完美运作,能够做我想做的一切。我希望在ngCordova / ionic中有一些突破性的变化,但我找不到它。

错误

<form id="form">

</form>

<a href="#" onclick="confirmSubmit('form')">Delete file</a>

function confirmSubmit(id) {
    var agree=confirm("Are you sure you wish to delete this file?");
    if (agree)
        document.getElementById(id).submit();
    else
        return false;
}

追踪

Cannot read property 'pushNotification' of undefined

at line:         $ionicPush.register({ 

代码(controllers.js)

TypeError: Cannot read property 'pushNotification' of undefined
    at Object.register (ng-cordova.js:6362)
    at init (ionic-push.js:146)
    at ionic-push.js:309
    at new Q (ionic.bundle.js:22259)
    at Q (ionic.bundle.js:22246)
    at Object.register (ionic-push.js:270)
    at Scope.$scope.pushRegister (controllers.js:60)
    at $parseFunctionCall (ionic.bundle.js:21172)
    at ionic.bundle.js:53674
    at Scope.$get.Scope.$eval (ionic.bundle.js:23228)

我更新了cordova,添加并删除了离子准备好的听众。我尝试在手机上运行它会出现此错误:enter image description here

你有什么建议吗?

1 个答案:

答案 0 :(得分:4)

尝试 终端中ionic config set dev_push true

我在这里发布了这个:https://github.com/driftyco/ionic-push-tutorial-app/issues/7