Hi @eric,
The error response InvalidTokenVersion
is from FCM and it is related to the device registration token/Instance ID token.
Since you are using the push-notification API to subscribe/unsubscribe, I’m assuming you are using JS based CometChat Pro SDK.
There is a possibility that the token is getting regenerated by FCM service. To keep the token updated, you need to use messaging.onTokenRefresh()
callback and store the updated token in a variable or localStorage based on your implementation. The updated token can then be sent to push-notification API to subscribe/unsubscribe from a topic.
// Callback fired if token is updated.
messaging.onTokenRefresh(() => {
messaging.getToken().then((refreshedToken) => {
console.log('Token refreshed.')
// update the token in localStorage.
}).catch((err) => {
console.log('Unable to retrieve refreshed token ', err);
});
});
Since we are unable to reproduce this issue at our end, please try this and let us know if this resolves the issue.