android - Goto particular path when push notification arrives (Angular, Ionic, ngcordova) -
consider scenario. have ionic / angular app , using the ngcordova plugin push notifications. let push notification arrives when app in background. user, views notification in app drawer , clicks notification further information. user navigate particular path using $location.path(). how can tap notification click event?
ok. turns out there no need tap notification click event. check if app in foreground using:
notification.foreground
so, if
if(notification.foreground) { //do case user using app. $popup('a notification arrived'); } else { //do case user not using app. $location.path('/tab/somepage'); }
Comments
Post a Comment