Allow push message doesn't shown on my app


#1

Hello. I hope somebody can help me out here.
i’ trying to make my app receive push notifications with ionic.io service.

I’ve created the IOS certificates
Also, I’ve followed the instructions:

and

When I open my project by running “ionic lab”, the console tells me:

"Ionic Push: Disabled! Native push notifications will not work in a browser. Run your app on an actual device to use push.

But I don’t get any log of tokens and when I build the package and open on my iPhone, nothing happens. The default message to allow push notifications is not being shown…

PLEASE!!! Anyone can help me???

My app.js is here:`

angular.module('app', ['ionic', 'app.controllers', 'app.routes', 'app.directives','app.services','promos','firebase','novidades','midias','cardapios','notificacoes','lojas','uiGmapgoogle-maps','googlemaps.init',])

.config(function($ionicConfigProvider, $sceDelegateProvider, $ionicCloudProvider){
    $ionicCloudProvider.init({
      "core": {
        "app_id": "1bdfbdad"
      },
      "push": {
        "sender_id": "328627862210",
        "pluginConfig": {
          "ios": {
            "badge": true,
            "sound": true
          },
          "android": {
            "iconColor": "#343434"
          }
        }
      }
    });

On controllers.js I have:

angular.module('app.controllers', ['ionic.cloud'])

.controller('promoEsCtrl', ['$scope', '$ionicPush', '$stateParams', 'promoService', 'dataTemp', 
function ($scope, $ionicPush, $stateParams, promoService, dataTemp) {

  $ionicPush.register().then(function(t) {
        return $ionicPush.saveToken(t, {ignore_user: true });
          }).then(function(t) {
            console.log('Token saved:', t.token);
          });

    $scope.$on('cloud:push:notification', function(event, data) {
    var msg = data.message;
    alert(msg.title + ': ' + msg.text);
    });

My index.html:

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
    <title></title>


    <script src="lib/bluebird.min.js"></script>
    <script src="lib/ionic/js/ionic.bundle.js"></script>
    <script src="lib/ionic.cloud.min.js"></script>

    <!-- cordova script (this will be a 404 during development) -->
    <script src="cordova.js"></script>

    <!-- IF using Sass (run gulp sass first), then uncomment below and remove the CSS includes above
    <link href="css/ionic.app.css" rel="stylesheet">
    -->


    <link href="css/ionic.app.css" rel="stylesheet">


    <style type="text/css">
      .platform-ios .manual-ios-statusbar-padding{
        padding-top:20px;
      }
      .manual-remove-top-padding{
        padding-top:0px;
      }
      .manual-remove-top-padding .scroll{
        padding-top:0px !important;
      }
      ion-list.manual-list-fullwidth div.list, .list.card.manual-card-fullwidth {
        margin-left:-10px;
        margin-right:-10px;
      }
      ion-list.manual-list-fullwidth div.list > .item, .list.card.manual-card-fullwidth > .item {
        border-radius:0px;
        border-left:0px;
        border-right: 0px;
      }
      .show-list-numbers-and-dots ul{
        list-style-type: disc;
        padding-left:40px;
      }
      .show-list-numbers-and-dots ol{
        list-style-type: decimal;
        padding-left:40px;
      }
    </style>

    <script src="js/app.js"></script>
    <script src="js/controllers.js"></script>
    <script src="js/routes.js"></script>


    <script src="https://www.gstatic.com/firebasejs/3.6.0/firebase.js"></script>

    <script src="https://cdn.firebase.com/libs/angularfire/2.1.0/angularfire.min.js"></script>

    <script src="js/directives.js"></script>

    <script src="js/services.js"></script>

    <script src="js/promocoes.js"></script>

    <script src="js/novidades.js"></script>

    <script src="js/midias.js"></script>

    <script src="js/cardapios.js"></script>

    <script src="js/notificacoes.js"></script>

    <script src="js/lojas.js"></script>

    <script src="https://cdn.jsdelivr.net/lodash/4.15.0/lodash.min.js"></script>

    <script src="js/angular-simple-logger.js"></script>

    <script src="js/angular-google-maps.min.js"></script>

    <script src="js/googlemaps.init.js"></script>


    <!-- Only required for Tab projects w/ pages in multiple tabs
    <script src="lib/ionicuirouter/ionicUIRouter.js"></script>
    -->

  </head>
  <body ng-app="app" animation="slide-left-right-ios7">
  <div>
  <div>
    <ion-nav-bar class="bar-royal">
      <ion-nav-back-button></ion-nav-back-button>
    </ion-nav-bar>
    <ion-nav-view></ion-nav-view>
  </div>
</div>
  </body>
</html>


Package.json:

{
    "name": "Deepfreeze",
    "version": "1.1.1",
    "description": "Deepfreeze: An Ionic project",
    "dependencies": {
        "@ionic/cloud": "^0.16.0",
        "bluebird": "^3.5.0",
        "gulp": "^3.5.6",
        "gulp-concat": "^2.2.0",
        "gulp-minify-css": "^0.3.0",
        "gulp-rename": "^1.2.0",
        "gulp-sass": "^2.0.4",
        "phonegap-plugin-push": "^2.0.0-rc3",
        "cordova-plugin-console": "1.0.5",
        "cordova-plugin-device": "1.1.4",
        "cordova-plugin-splashscreen": "~4.0.1",
        "cordova-plugin-statusbar": "2.2.1",
        "cordova-plugin-whitelist": "1.3.1",
        "ionic-plugin-keyboard": "~2.2.1"
    },
    "devDependencies": {
        "bower": "^1.3.3",
        "gulp-util": "^2.2.14",
        "shelljs": "^0.3.0"
    },
    "cordovaPlugins": [
        "cordova-plugin-whitelist",
        "cordova-plugin-statusbar",
        "cordova-plugin-console",
        "cordova-plugin-device",
        "cordova-plugin-splashscreen",
        "ionic-plugin-keyboard"
    ],
    "cordovaPlatforms": [
        "ios",
        {
            "platform": "ios",
            "version": "",
            "locator": "ios"
        }
    ],
    "cordova": {
        "plugins": {
            "phonegap-plugin-push": {
                "SENDER_ID": "328627862210"
            },
            "cordova-plugin-console": {},
            "cordova-plugin-device": {},
            "cordova-plugin-splashscreen": {},
            "cordova-plugin-statusbar": {},
            "cordova-plugin-whitelist": {},
            "ionic-plugin-keyboard": {}
        }
    }
}

#2

Looks like your code its in IONIC V1 and the documentation you are following is from IONIC V2 … are you using IONIC V1?