$ionicPush undefined


I have troubles when calling $ionicPush.register() - $ionicPush seems to be undefined.

ionic-push.js gets loaded correctly and dependencies are set:

angular.module('meetat', [

Controller code:

.controller('LoginCntrl', function ($scope, $http, $state, $ionicLoading, $rootScope, $ionicUser, $ionicPush) {

        var fbLoginSuccess = function (userData)
            facebookConnectPlugin.getAccessToken(function (token)
            }, function (err) {

        $scope.login = function () {
            facebookConnectPlugin.login(["public_profile, user_events, user_birthday, user_friends, user_photos"],
                    function (error) {
                        alert("Login not possible.");

        $scope.identifyUser = function () {
            var user = $ionicUser.get();
            if (!user.user_id) {
                user.user_id = $scope.userId;
            $ionicUser.identify(user).then(function () {
                $scope.identified = true;
                console.log('Identified user ' + user.name + '\n ID ' + user.user_id);

        // Registers a device for push notifications
        $scope.pushRegister = function () {
            console.log('Ionic Push: Registering user');

            // Register with the Ionic Push service.  All parameters are optional.
                canShowAlert: true, //Can pushes show an alert on your screen?
                canSetBadge: true, //Can pushes update app icon badges?
                canPlaySound: true, //Can notifications play a sound?
                canRunActionsOnWake: true, //Can run actions outside the app,
                onNotification: function (notification) {
                    // Handle new push notifications here
                    return true;

        $scope.initUser = function () {

        $scope.getFacebookLoginStatus = function () {

Additional information:

  • $ionicUser.identify gets called without problems and the response is correct. Users appear @ Ionic Dashboard.
  • The error does not appear when dev_mode set to true,
  • All API keys are set (gcm_id as well) and verified multiple times.

Thanks for your help.

anybody here who can help me?

this could help

Possible errors like missing gcm_id or testing on virtual devices are not the problem in my case…


I have exactly the same problem …

Hi Adel,

I got the problem solved by manually adding “ionic plugin add https://github.com/phonegap-build/PushPlugin.git”. The strange thing is that I also had the problem on the official ionic demo app - one would think that all dependencies are added automatically…

Thank you it works !

This dependency should be mentionned in the documentation because i have followed the doc step by step and this problem occured.

hi @Adel and all, i want to ask about badges “canSetBadge: true”, but in ionic icon not recieve or show budge. Is there any can help me? thanks