2

I have successfully set $ionicPush (ionic cloud) notification, and I'm able to receive push notification successfully on android device.

But when my android app is closed/background what i would like to do is when I click on received notification in notification area, I want to transit to specific state based on notification param/payload.

I'm passing message by FCM dashboard with

payload : {"$state":"stateName"}

Below is my code for receiving notifications

$rootScope.$on('cloud:push:notification', function(event, notification) {    
        var state=notification.message.payload.$state;
        console.log("State:" + state);
        if (typeof state != 'undefined') {
            window.localStorage.setItem('goafterpush',state);
        }
    });

But this above listener is not called when I clicked on received notification.

Can anyone please help me out to solve this issue, as I have already spent 2 days to solve it.

Vijay Mistry
  • 157
  • 5

0 Answers0