Closed jddeep closed 2 years ago
@TatankaConCube Please take a look here
@jddeep could you please provide the log after calling the SubscribeService.unSubscribeFromPushes(applicationContext)
. Do you have any errors there?
What unexpected behavior do you get with this issue? Why do you need the new token after unsubscription?
@TatankaConCube No there are no errors. All the process works good. We don't need new token. We want old token only. The issue is this line of code changes destroys the old token and a new token is generated by firebase messaging after re login. We removed the line and checked and everything was fine. The old token was reserved.
within SDK we call instanceID.deleteToken(senderId, FirebaseMessaging.INSTANCE_ID_SCOPE);
and clean your data related to FCM, just FYI
Well that is exactly what's causing this @TatankaConCube ! Can you tell why exactly are you doing this? And other than this what all things are you doing under the hood while unsubscribing
in my preview comment, I said, what we do while calling SubscribeService.unSubscribeFromPushes(applicationContext)
why exactly are you doing this
we do this for stopping receiving push notifications in the app.
But you can realize own logic for unsubscribing from push notifications, for this, you have to save the subscription id and use it for deleting subscription via our API:
ConnectycubePushNotifications.deleteSubscription(subscriptionId);
Closing this for now
SubscribeService.unSubscribeFromPushes(applicationContext)
This is the line which is responsible for this. After uncommenting this the fcm token is survived even after logout and doesn't change for the user which is what we want.