问题
If I authenticate using Auth#signInWithPopup I get a result having credentials.
How can I get the same credentials inside the observer for Auth#onStateChanged?
回答1:
You can't get the credentials from Auth#onStateChanged. You can only get them from the result of Auth#signInWithPopup or Auth#getRedirectResult. As these fields are only obtained once on sign-in and not maintained or stored by Firebase Auth (eg. OAuth credential, additional IdP data), they are only returned on sign-in completion.
来源:https://stackoverflow.com/questions/44433444/get-facebook-google-access-token-on-firebase-authonauthstatechanged