Uncaught ReferenceError: Ionic is not defined

0

I'm trying to make an "Android Push Notification" with ionic.io . I'm stuck on an error that I can not resolve:

  

"Uncaught ReferenceError: Ionic is not defined"

I tried everything and could not solve.

  • Can you generate this error?

This is the code

var push = new Ionic.Push({ // linha do erro
"debug" : true
});
    
asked by anonymous 08.03.2016 / 17:16

1 answer

1

Set the service in the following places:

At the command line, add the webclient platform and plugin

    $ ionic add ionic-platform-web-client
    $ ionic plugin add phonegap-plugin-push --variable SENDER_ID="GCM_PROJECT_NUMBER"
    $ ionic io init

on main page load (index.html):

    <script src="lib/ionic-service-core/ionic-core.js"></script>

// on application load (app.js?):

    angular.module('App', [ 'ionic', 'ionic.service.core', ...

Run the app and check the Chrome console:

>Ionic
   Object {DataTypes: Object, IO: Object, ...
    
28.03.2016 / 12:53