Handling device Token with “Plugin.FirebasePushNotification”

mhmdmhmd Member ✭✭
edited July 1 in Xamarin.Forms

I installed the plugin written in the title. I'm a little bit confused about the devices token. I'm using this code in MainActivity class for android:

FirebasePushNotificationManager.Initialize(this, true);
 CrossFirebasePushNotification.Current.OnTokenRefresh += (s, p) =>
            {
                System.Diagnostics.Debug.WriteLine($"TOKEN : {p.Token}");
                StaticClass.NotificationsToken = p.Token;
            };

so I get the token and save it in my static class. But when I set the resettoken to false to run the application normally on the device like this :

FirebasePushNotificationManager.Initialize(this, false);

How do I Get the device token? And is there something that could be called in PCL to save the token for both iOS and Android? Thanks in advance

Best Answer

Answers

Sign In or Register to comment.