问题
This question is relative to this issue Firebase-Android, How to sync data when resume after connection lost?
Step-by-step is:
- First I login using email method in Auth Activity
- In Timeline activity I add an record.
Everything looks good. But if I minimize app for about 24 hours, then resume application at timeline activity and add new record, I got error: "java.lang.Exception: Permission denied". I'm sure nothing wrong with new data, but:
path / {
read() = true;
write() = isSignedIn();
}
isSignedIn() = auth != null;
So I think that after long idle, maybe session was timeout.
Have you got same issue, and how to overcome this?
回答1:
I solve this issue by saving last login credential (email + password) then call login with email again when app resumed (onResume event of Activity)
来源:https://stackoverflow.com/questions/34384635/firebase-android-fail-to-save-data-after-long-time-idle