Ios receiving notification but not triggering 'on' event


#1

Hi I’m debugging on a older model.

In the xcode console I am getting the message
Ionic Push: (debug) notification received: <PushMessage ['Test Push6']>

Furthermore this will open my ionic app to the main page (dashboard). However it is not triggering my ‘on’ event. The on event triggers on my android ZTE axon 7.

Here is the code for the event, I run it in the app.js

.run(function($ionicPlatform, $ionicAnalytics, $rootScope, $state, $timeout, AuthenticationService) {


  $rootScope.$on('cloud:push:notification', function(event, data) {
    var msg = data.message;
    console.log("hello???");
    //console.log("We got a push notifcation");
    //alert(msg.title + ': ' + msg.text);
    $state.go("app.newReportSwitch");
  });
})

I get the “hello” message and the state switch on android, but not on IOS.

Is it possible this is an older device issue, or am I doing something wrong? maybe I am supposed to call device ready first.


#2

Hi, this post got pushed down because it wasn’t approved so I’m hoping to bump it back to the top.