Ionic config set gcm_key <your-gcm-project-number> returns "config is not a valid task"


#1

I’m following this guide: http://docs.ionic.io/docs/push-android-setup and when I type " ionic config set gcm_key " in my console I get config is not a valid task error… ofc I put my gcm number in the command after gcm_key, that’s not the problem…
Anyone has a clue?


#2

Hi @kresogalic,

I just encountered the same issue, and I found you can set the gcm_key in your module config:

var myModule = angular.module(...)
.config(['$ionicAppProvider', function($ionicAppProvider) {

    $ionicAppProvider.identify({
        // The App ID (from apps.ionic.io) for the server
        app_id: 'YOUR_APP_ID',
        // The public API key all services will use for this app
        api_key: 'YOUR_APP_KEY',
        // The GCM project ID (project number) from your Google Developer Console (un-comment if used)
        // gcm_id: 'YOUR_GCM_ID'
      });
}]);