Handling push notification in controller when app is in foreground


#1

HI there,

i’ve been following along the great documentation for adding push notifications to my app using ionic.io services,

the only missing piece is how do i listen for an event of a push notification inside the app, specifically in one of my controllers?

i know the “$ionicPush.register” has the ‘onNotification’ handler, but since i’m registering for push in my login state, i can’t add logic specific to some controller.

should i use the ngCordova --> $rootScope.$on(’$cordovaPush:notificationReceived’, func(event, notification))

Code?

Thanks!