Sign In Register

How can we help you today?

Start a new topic

removePushRegistration doesn't propagate "unsubscribe" to GCM

Please move this to Questions if it is not a bug...


So i am using FCM for my push notifications, i integrated it with gamesparks and all is working.

However - if user decided to opt out from push notifications, using the  

Spark.getPlayer().removePushRegistration(registrationId);

 it does delete his push registration entry from playerdata, but it does not send unsubscrube to the FCM-> which results in that player still receiving push notifications if they are sent from FCMconsole directly.


expected: also unsubscribes the usertoken from FCM. Else, it is mostly pointless to integrate gamesparks with FCM, if we need to keep 2 separate "opt in/out" collections aynway...


Is this intended behavior, or a bug?


Best regards, Simon


edit:
i am registering players with SetDeviceOS("FCM") as per tutorials (and it was only way to get scriptmessages to work too)

 

 

1 Comment

right so i'll answer my solution for this - in case anyone ever wonders:
it's a dirty one but it works -basically i delete firebaseinstanceid(this is what identifies device for purposes of push notifications)


 Firebase.InstanceId.FirebaseInstanceId.GetInstanceId(FIREBASE_APP).DeleteIdAsync();

 So this will assing new id to the device, but it doesn't matter since this one is not subscribed now unless you call subscribe even obviously.


let me just note that i subscibe manually, via explicit player opt in dialog -> as is required by stores etc... if you had automatic opt in this wouldn't do much as it would just re-subscribe to new instance id.


happy coding


Login to post a comment