iOS. Firebase.CloudMessaging. Could not unsubscribe from push notification

Hi. I have problem with push notification on iOS. I tried to do all steps according documentation
github.com/xamarin/GoogleApisForiOSComponents/blob/master/docs/Firebase/CloudMessaging/GettingStarted.md

I'm getting new token on staring app, and tried to remove it on signout like this
await Task.Run(() => InstanceId.SharedInstance.DeleteId((error) => { Mvx.Trace(error?.DebugDescription); }));

But anyway, I get pushes in signed outed app. After second sign in I get two pushes (amount of pushes equals to amount of sign ins).
A we can see we get push to old tokens too.
Xamarin.Firebase.iOS.CloudMessaging 3.1.2 Xamarin.Firebase.iOS.InstanceID 3.2.1 Xamarin.Firebase.iOS.Core 5.1.3

Subscribe user for topic request
POST iid.googleapis.com/iid/v1:batchAdd request body { "to" : "/topics/test", "registration_tokens" : ["..user_registration_token.."] }

server send periodically notifications to the topics
Send notification for topic subscribers request
POST fcm.googleapis.com/v1/projects/our_project_id/messages:send request body { "message": { "topic":"test", "notification": { "title":"test-6", "body":"test-6" } } }

when user logout from application, server perform unsubscribing user token from topic
POST iid.googleapis.com/iid/v1:batchRemove { "to": "/topics/test", "registration_tokens" : ["..user_registration_token.."] }

But, when user login again and request brand new token, device still received push notifications witch are sending to the old token, and if we send notifications by the topic such users received dublicate push notifications.

If we try get information for old token from api method

GET iid.googleapis.com/iid/info/token.....
we get response
<HTML> <HEAD> <TITLE>Internal Server Error</TITLE> </HEAD> <BODY BGCOLOR="#FFFFFF" TEXT="#000000"> <H1>Internal Server Error</H1> <H2>Error 500</H2> </BODY> </HTML>

Sign In or Register to comment.