Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70612

How to load the correct state after a push notification when app is in background?

$
0
0

@prabhu_108 wrote:

I'm trying to save some data to local storage when a push notification arrives (users sometime have to login when they click on the push notification before I can take them to the correct view), but it seems like the data I save to localstorage at the time the push notification arrives is always null. Is there not access to window.localStorage in the onNotification event handler for ionic push?

Here is my code:

$ionicPush.register({
canShowAlert: true,
onNotification: function(notification) {
window.localStorage.setItem('someData', notification.payload.somedata);
}
})

When I try window.localStorage.getItem('someData') it's always null.

Posts: 3

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 70612

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>