Comments (4)
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.
I was expecting to get a new token if that was required. I have this situation:
- the plugin returns the token the first time, I store this token on the my DB on the cloud.
- 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.
- 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.
same issue for me. after updating the app in Xamarin Studio, GCM/PushSharp says the device token is expired. I have to either:
- uninstall the whole app and reinstall again (which is not a good idea)
- 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.
Now calls OnRegistered each time gets registered by Register method
from xamarin-plugins.
Related Issues (20)
- PushNotifications: Empty Body with FCM on Android HOT 1
- Help configuring custom icon and sound on notification HOT 2
- How do I get the Accelerometer and Magenetometer values simultaniously?
- got an error while registering push notifications HOT 4
- CrossPushNotificationListener Missing
- UWP notifications not firing HOT 3
- ANDROID Crash INVALID_PARAMETERS HOT 1
- MotionVector.cs ToString implementation
- Android - calling register() causes nav bar to disappear. HOT 1
- How can i convert the ((MotionVector)a.Value).Z from accelerattor to a angle? HOT 1
- Edit push notification sound
- Reconvert iOS Device Token to NsData problem
- Problem receiving push in iOS 11 HOT 3
- Tizen support
- Android 8 not getting notifications HOT 1
- Light Sensor
- Support .Net standard 2.0
- device motion, SensorValueChanged not fired
- Sample App is not working
- All plugins are deprecated
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xamarin-plugins.