在 Facebook 中保持登录状态?

Stay Logged in in Facebook?

我使用 inAppBrowser 成功地将 Facebook 登录与我的 android 应用程序(Cordova + Ionic Framework)连接起来。我现在的问题是如何让用户登录只需一次,然后下次他们打开应用程序时,他们会自动连接而无需再次登录?

我看到了一个与我类似的问题,但它在 ASP.NET 中,该问题的答案是 A) "use localstorage to save credentials. But bad idea. Cause localstorage life cycle isn't good enough. Specially iPhone treats localstorage as temporary storage" B) "use database like webSql to save the credentials in your app"... blah3x

以上针对 ASP.NET 的建议是否也适用于 Cordova?或者还有另一种(更好的)方法?谢谢

您需要保存用户令牌。此令牌通常会持续 1 个月左右,使用此令牌您可以继续使用而无需再次要求登录。