火力地堡,Android的,无法保存较长时间闲置后的数据 [英] Firebase-Android, Fail to save data after long time idle
问题描述
此问题是相对于这个问题<一href=\"http://stackoverflow.com/questions/34259016/firebase-android-how-to-sync-data-when-resume-after-connection-lost\">Firebase-Android,恢复连接后丢失如何同步数据?
This question is relative to this issue Firebase-Android, How to sync data when resume after connection lost?
步骤一步是:
- 首先,我登录使用电子邮件方法验证活动
- 在时间轴的活动我添加一个记录。
一切都看起来不错。但是,如果我减少了约24小时的应用程序,然后继续在时间轴活动应用程序并添加新的记录,我得到了错误:java.lang.Exception的:权限被拒绝。我敢肯定没有错,新的数据,但是:
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?
推荐答案
我解决这个问题,通过保存最后的登录凭据(电子邮件+密码),然后再次调用与电子邮件密码时,应用恢复(活动的onResume事件)
I solve this issue by saving last login credential (email + password) then call login with email again when app resumed (onResume event of Activity)
这篇关于火力地堡,Android的,无法保存较长时间闲置后的数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!