Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70612

onNotification event doesn't fire when app is in background

$
0
0

@pabarch wrote:

HI all,

I can't figure it out how to make the onNotification event to run when I receive a notification and the app is in background. I'm using ionic push api v2 and everyhing works fine except for this. Does anyone know if this currently works and if that is the case what "special" options should be send through the notification api?

Example code:

    $ionicPlatform.ready(function() {
        $ionicPush.init({
            debug: true,
            onNotification: function(notification) {
                $state.go('app.login');
            },
            onRegister: function(data) {
                dtlDevice.setToken(data.token);
            }
        });
        $ionicPush.register();
    });

Thanks!!

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 70612

Trending Articles