localStorage cleared on app restart with Cordova 1.7 and iOS 5.1.1

后端 未结 1 779
天命终不由人
天命终不由人 2020-12-20 08:05

From my extensive reading, the iOS 5.1 localStorage/WebSQL behavior change that Apple instituted has been fully rolled into Cordova 1.6.0. However, while running on my (new)

相关标签:
1条回答
  • 2020-12-20 08:17

    Try using 1.7 - I had a similar issue and once I upgraded to 1.7 everything worked like it used to.

    Try using localStorage vs window.localStorage syntax.

    Also set what ever you're trying to call as a global variable...

    var globalVar;
    
    function onDeviceReady(){
      globalVar = localStorage.getItem('something');
    }
    
    0 讨论(0)
提交回复
热议问题