Uncaught ReferenceError: Ionic is not defined for Ionic Push Uncaught ReferenceError: Ionic is not defined for Ionic Push angularjs angularjs

Uncaught ReferenceError: Ionic is not defined for Ionic Push


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>


This error occurs before you run ionic io init. It's also necessary to run ionic config set dev_push true right after that if you're running the app in a browser (otherwise you'll get "PushNotification is not defined"). The whole push notification setup procedure is described here.


In following the setup steps, Ionic CLI autowrote to my index.html:

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

but I had to manually retrieve the source file (ionic.io.bundle.min.js) from:

https://raw.githubusercontent.com/driftyco/ionic-platform-web-client/master/dist/ionic.io.bundle.min.js

and put it in the expected directory:

lib/ionic-platform-web-client/dist/

I also had to disable and then re-enable limited pushes from the CLI:

ionic config set dev_push true

Nothing else worked for me. Good luck!