Unknown provider: $ ionicAppProvider

I get this error when I try to install GCM push api key in app.js

Here is the code I'm using:

.config(['$ionicAppProvider', function($ionicAppProvider) { // Identify app $ionicAppProvider.identify({ // The App ID for the server app_id: 'MY_APP_ID', // The API key all services will use for this app api_key: 'MY_API_KEY', //The GCM project number gcm_id: 'MY_GCM_PROJECT_NUMBER' }); }]) 
+8
angularjs ionic-framework google-cloud-messaging
source share
2 answers

It seems that you did not install the module with the ion service and did not configure the application. You will need to do the following:

1) Install Ionic Service Core. Run ionic add ionic-service-core at the command prompt for your project

2) Add this script tag to index.html

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

3) Add the ionic.service.core module to your app.js as follows:

 angular.module('starter', ['ionic', 'ionic.service.core', 'starter.controllers']) 
+7
source share

You may have implemented an ionic base service in front of your module. Try the following:

 angular.module('starter', [ 'ionic', 'ionic.service.core', 'your.module' ]); 
0
source share

All Articles