Giter VIP home page Giter VIP logo

Comments (4)

rdelrosario avatar rdelrosario commented on September 16, 2024

Yes is only trigger one time now because stores the token, if you need it to trigger more than once. should unregister. Why would you want to trigger everytime?

from xamarin-plugins.

aunanue avatar aunanue commented on September 16, 2024

I was expecting to get a new token if that was required. I have this situation:

  1. the plugin returns the token the first time, I store this token on the my DB on the cloud.
  2. with a service on the cloud that has no connection at all with the App I send the Push messages using PushSharp. In some cases the token returned by the plugin expires therefore I need a new one.
  3. at this point I was expecting to receive a new token by the plugin but if I understand properly, I will have to do a sort of communication between the cloud and the App to do the "Plugin.Unregister()" when the PushSharp receives the expired token exception because the plugin does not checks the validity of the current token on the Plugin.Register() method.

In the mean time, can I call the Unregister() followed by the Register()? do you see a problem on this as follows:
protected override void OnStart ()
{
// Handle when your app starts
CrossPushNotification.Current.Unregister();
CrossPushNotification.Current.Register();
}

from xamarin-plugins.

MKahmen avatar MKahmen commented on September 16, 2024

same issue for me. after updating the app in Xamarin Studio, GCM/PushSharp says the device token is expired. I have to either:

  1. uninstall the whole app and reinstall again (which is not a good idea)
  2. call unregister() each time I open the app to make sure the app gets a new token which is not expired (very dirty)

any ideas?

EDIT:
#28

http://stackoverflow.com/questions/11590482/do-gcm-registration-ids-expire

When an application is updated, it should invalidate its existing registration ID, as it is not guaranteed to work with the new version. Because there is no lifecycle method called when the application is updated, the best way to achieve this validation is by storing the current application version when a registration ID is stored.

from xamarin-plugins.

rdelrosario avatar rdelrosario commented on September 16, 2024

Now calls OnRegistered each time gets registered by Register method

from xamarin-plugins.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.