0

我正在尝试将我的应用程序更改为使用 firebase-simple-login 并在使用 cordova/ionic 的混合移动应用程序中使用。我遇到了持久性问题。我查看了 firebase-simple-login.js 代码,看来该库依赖于 cookie 和 localStorage 都可用:

fb.simplelogin.SessionStore_.prototype.get = function() {
    if (hasLocalStorage) {
        try {
            var a = goog.net.cookies.get(encryptionStorageKey),
                d = localStorage.getItem(sessionPersistentStorageKey);
            if (a && d)  return fb.simplelogin.util.json.parse(sjcl.decrypt(a, fb.simplelogin.util.json.parse(d)))
        } catch (e) {
        }
        return null
    }
};

对此进行调试,我看到 d 已成功返回,但是当在 android 上使用 cordova 作为本机安装运行时,a 未设置但 d 设置。所以,坚持是永远不会成功的。

仅供参考,我安装了 InAppBrowser 插件并安装了 bez4pieci.cookies。

我“应该”在本机运行时能够解决 cookie 的问题吗?目前没有。至少以firebase期望的方式。

4

0 回答 0