【发布时间】:2018-11-09 05:46:09
【问题描述】:
即使应用程序关闭,如何让用户使用 firebase 保持登录状态?我听说本地设备存储是不行的。
【问题讨论】:
-
你在使用离子原生火力基地吗?或类似this
标签: firebase ionic-framework firebase-authentication ionic4
即使应用程序关闭,如何让用户使用 firebase 保持登录状态?我听说本地设备存储是不行的。
【问题讨论】:
标签: firebase ionic-framework firebase-authentication ionic4
如果您没有使用 ionic 本机 firebase 插件,而是使用类似 tutorial 中的内容,您可以使用下面的代码
firebase.auth().onAuthStateChanged(function(user) {
if (user) {
// User is signed in.
} else {
// No user is signed in.
}
});
请阅读documentation了解更多详情
【讨论】: