简体   繁体   English

反应本机身份验证('继续为')

[英]React native authentication('Continue As')

Good day guys,so i am trying to implement a feature in my react native app....After a user has logged in and later logs out of the app,i want to add a feature on the login screen to ask if the user wants to continue as the previous user that was logged in,please how do i go about it?伙计们,大家好,所以我正在尝试在我的本机应用程序中实现一个功能......在用户登录并稍后退出应用程序后,我想在登录屏幕上添加一个功能来询问用户想以之前登录的用户身份继续,请问我该怎么做? Sample User interface示例用户界面

i'm new in react-native.我是 react-native 的新手。 but i think i have some solution:但我想我有一些解决方案:

  1. Using local storage, store user id or somthing for login.使用本地存储,存储用户 id 或登录的东西。
  2. When user login, you can get device id and store it to your database.当用户登录时,您可以获取设备 ID 并将其存储到您的数据库中。 When user into app: check device id, detected previous user logged.当用户进入应用程序时:检查设备 ID,检测到以前的用户登录。

When ever a new user logs in try to save details like email or username in Async storage(which is one way to store values in React native).当新用户登录时,尝试将电子邮件或用户名等详细信息保存在异步存储中(这是在 React Native 中存储值的一种方式)。 And when the user logs out you can show the details which you had stored in Async storage.当用户注销时,您可以显示存储在异步存储中的详细信息。 Hope, this helps!希望这可以帮助!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM