【问题标题】:Ionic 4 Firebase IOS Application离子 4 Firebase IOS 应用程序
【发布时间】:2018-11-09 05:46:09
【问题描述】:

即使应用程序关闭,如何让用户使用 firebase 保持登录状态?我听说本地设备存储是不行的。

【问题讨论】:

  • 你在使用离子原生火力基地吗?或类似this

标签: firebase ionic-framework firebase-authentication ionic4


【解决方案1】:

如果您没有使用 ionic 本机 firebase 插件,而是使用类似 tutorial 中的内容,您可以使用下面的代码

firebase.auth().onAuthStateChanged(function(user) {
  if (user) {
    // User is signed in.
  } else {
    // No user is signed in.
  }
});

请阅读documentation了解更多详情

【讨论】:

    猜你喜欢
    • 2018-01-29
    • 1970-01-01
    • 1970-01-01
    • 2016-06-30
    • 2018-06-27
    • 2018-07-29
    • 2019-08-03
    • 2018-03-01
    • 2016-01-27
    相关资源
    最近更新 更多