Firebase-Android, Fail to save data after long time idle

百般思念 提交于 2020-01-03 17:47:16

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!