【问题标题】:why is localstorage on phonegap Cordova working on iOS10 but not iOS 9?为什么 phonegap Cordova 上的 localstorage 在 iOS10 上运行而不是在 iOS 9 上运行?
【发布时间】:2017-05-25 17:12:18
【问题描述】:

使用cordova 应用程序。 我已经为 iOS 10 更新了所有内容。本地存储在 iOS 10 上运行良好,但在 iOS 9 上完全不工作。为什么?

我的代码的一个简单示例:

localStorage.setItem("events", JSON.stringify(eventsList), 1);
var dataCached = JSON.parse( localStorage.getItem( "events" ) );

在不同版本的 iOS 上使用 localstorage 有什么需要注意的吗?在我使用cordova platform update ios 并更新了cordova 之前,它曾经工作得很好。

谢谢

【问题讨论】:

    标签: javascript android ios cordova local-storage


    【解决方案1】:

    由于内存不足,在 iOS 8 之后 localStorage 随机清除,所以可能该东西在 iOS 10 中已删除,尚未测试

    欲了解更多信息,请参阅https://forum.ionicframework.com/t/ios-localstorage-persistence/20004/11

    【讨论】:

    • 我的问题是它甚至不存储它。某些操作需要访问存储在本地存储中的数据 10 秒,即使这样也行不通。用户没有离开应用程序。
    猜你喜欢
    • 2013-11-09
    • 2019-05-25
    • 1970-01-01
    • 2017-03-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-01-01
    • 1970-01-01
    相关资源
    最近更新 更多