I have created a chat app using ionic push and it works in all cases - (foreground, background, coldstart). The problem i am having is that when the app is in coldstart and the user receives a notification and clicks on it, the app opens and the controller specified in the $urlRouterProvider.otherwise is run and only then does the onNotification method run. I do a redirect in the onNotification method, so the app opens , it loads the page and runs the default controller and only then does it redirect to the page mentioned in the push payload.
Is there a way to trigger the onNotification method to run immediately after notification click, currently it executes after the controller starts executing.
My Push register and onNotification methods are in the app.js file inside the run method.
I am building for android, using ionic 1.7.15, cordova 6.1.
Any suggestions, help is appreciated.