I have an ionic app made with ionic1 and using OneSignal for push notification. Currently, one signal works well for push notification when: - app is already open - app is in background or kill, clicking on the push notification
using these 2 functions handleNotificationReceived and handleNotificationOpened
window.plugins.OneSignal.handleNotificationReceived(function(jsonData) {
$state.go('panicalarm');
console.log("navigate to panicalarm page");
})
window.plugins.OneSignal.handleNotificationOpened(function(jsonData) {
$state.go('panicalarm');
console.log("navigate to panicalarm page");
})
I am wondering, how do i handle the push notification when launching the app directly or from bringing the app from background to foreground without clicking on the push notification ? Is that possible ?