I tried several ways, like:
auth.currentUser.reload();
auth.currentUser.getIdToken(true);
but none of them works, the onAuthStateChanged listener is not getting called. Its very important for me. Thanks.
>Solution :
The onAuthStateChanged event is triggered by the SDK when the user’s auth state change, so when it goes from not being signed in to being signed in – or vice versa.
If you want to detect when their ID token changes, you’ll want to listen for onIdTokenChanged instead.
There is no way to trigger these event from your own code, although you can of course execute the same code yourself whenever you have another need.