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:
- Should push.register() be called at every app start?
- How do I retrieve a token saved with push.saveToken?
Cheers