has anyone experienced this issue? My firebase code only works for basically a couple of hours (fully functional and all), and then when I try again it doesn\'t work anymore
This issue is caused by Firebase Auth tokens not refreshing themselves properly, which itself is caused by an underlying misconfiguration in your Firebase project.
You can tell if the token refresh is failing by calling the following snippet after you sign a user in:
FirebaseUser user = mAuth.getCurrentUser(); // mAuth is your current firebase auth instance
user.getToken(true).addOnCompleteListener(this, new OnCompleteListener<GetTokenResult>() {
@Override
public void onComplete(@NonNull Task<GetTokenResult> task) {
if (task.isSuccessful()) {
Log.d(TAG, "token=" + task.getResult().getToken());
} else {
Log.e(TAG, "exception=" +task.getException().toString());
}
}
});
(If there is an issue, you will get an exception).
You can follow this guide that we have put together in the Firebase team to troubleshoot and fix any issues with configuration that can cause this problem.
The above steps should be a permanent fix for the issue, however, we are also working hard to implement a way of automatically detecting misconfigurations and fixing them transparently for you. Apologies for any problem this may have caused you.