Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49526

Do I need to call push.register() every time my app starts

$
0
0

@pinne65 wrote:

What am I missing here: http://docs.ionic.io/docs/push-full-setup#section-3-5-add-some-push-code?

I'm saving the token to a server from the push.register function parameter. So every time the app starts it goes out to that server and tries to save. Duplicate requests are ignored of course. But I'd like to avoid unnecessary web calls.

I was thinking there was a push."retrieve"Token() or something to match push.saveToken(), so that I could see if the token was already set (and the app wouldn't have to make extra web calls). But I couldn't find anything. I could of course save / retrieve from local storage. No biggie, but I'm looking for the preferred way.

Just to recap, two questions:
1. Should push.register() be called at every app start?
2. How do I retrieve a token saved with push.saveToken?

Cheers

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 49526

Trending Articles



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