0

I was following this article: Ionic Push Notification Guide

But after doing all the steps I keep getting a "Ionic is not defined" in the next line of the app.js of my ionic application:

var push = new Ionic.Push({
  "debug": true
});

I dunno why this is happening, but this is my angular.module.run function complete for more insight in the matter:

.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);
    });
  });
})

Please, tell me any additional information I could provide to make this issue more clear.

1 Answer 1

1

Try this :

Just add below line after

<script src="lib/ionic/ionic.bundle.js"></script>

in your index.html file.

<script src="lib/ionic-platform-web-client/dist/ionic.io.bundle.js"></script>

and use this comand: ionic config set dev_push true

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.