Open lbulegato opened 2 years ago
In Xamarin.Firebase.Messaging version 122.0.0.3 (latest stable)
If you delete a token with the following code, and Messaging.SharedInstance.AutoInitEnabled = true;
Messaging.SharedInstance.AutoInitEnabled = true;
Messaging.SharedInstance.DeleteToken(new MessagingDeleteFcmTokenCompletionHandler((error) => { if (error != null) Logger.Info($"DeleteToken error=[{error.LocalizedDescription}]"); }));
TheDidReceiveRegistrationToken(Messaging messaging, string fcmToken) is called 2 times:
DidReceiveRegistrationToken(Messaging messaging, string fcmToken)
so it seems that Messaging.SharedInstance.AutoInitEnableddoesn't restore the token, but if you do this change:
Messaging.SharedInstance.AutoInitEnabled
Messaging.SharedInstance.AutoInitEnabled = false; Messaging.SharedInstance.DeleteToken(new MessagingDeleteFcmTokenCompletionHandler((error) => { if (error != null) Logger.Info($"DeleteToken error=[{error.LocalizedDescription}]"); Messaging.SharedInstance.AutoInitEnabled = true; }));
The DidReceiveRegistrationToken(Messaging messaging, string fcmToken) is called 2 times, with the expected order
The DidReceiveRegistrationToken(Messaging messaging, string fcmToken)
Just a plus, if you try the deprecated method
InstanceId.SharedInstance.DeleteId(new InstanceIdDeleteHandler((error) => { if (error != null) Logger.Info($"DeleteId error=[{error.LocalizedDescription}]"); }));
You don't need to fake the Messaging.SharedInstance.AutoInitEnabled and the sequence of calls for The DidReceiveRegistrationToken(Messaging messaging, string fcmToken) is right.
In Xamarin.Firebase.Messaging version 122.0.0.3 (latest stable)
If you delete a token with the following code, and
Messaging.SharedInstance.AutoInitEnabled = true;
The
DidReceiveRegistrationToken(Messaging messaging, string fcmToken)
is called 2 times:so it seems that
Messaging.SharedInstance.AutoInitEnabled
doesn't restore the token, but if you do this change:The DidReceiveRegistrationToken(Messaging messaging, string fcmToken)
is called 2 times, with the expected orderJust a plus, if you try the deprecated method
You don't need to fake the
Messaging.SharedInstance.AutoInitEnabled
and the sequence of calls for TheDidReceiveRegistrationToken(Messaging messaging, string fcmToken)
is right.