Uncaught Referenceerror: Ionic is not defined

Asked

Viewed 240 times

0

I’m trying to perform a "Android Push Notification" with the Ionic.io. I’m caught in a mistake I can’t fix:

"Uncaught Referenceerror: Ionic is not defined"

I’ve tried everything and I can’t fix it.

  • can generate this error?

That is the code

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

1 answer

1


Set the service in the following places:

in the command line, add the Webclient platform and the plugin

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

loading the main page (index.html):

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

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

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

run the app and check on the Chrome console:

>Ionic
   Object {DataTypes: Object, IO: Object, ...

Browser other questions tagged

You are not signed in. Login or sign up in order to post.