You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by "Christian Hemker (JIRA)" <ji...@apache.org> on 2012/09/25 15:54:07 UTC

[jira] [Created] (CB-1535) LocalStorage is not saved after first App launch on iOS 6

Christian Hemker created CB-1535:
------------------------------------

             Summary: LocalStorage is not saved after first App launch on iOS 6
                 Key: CB-1535
                 URL: https://issues.apache.org/jira/browse/CB-1535
             Project: Apache Cordova
          Issue Type: Bug
          Components: iOS
    Affects Versions: 2.1.0
         Environment: iOS 6.0 - iOS Simulator
iOS 6.0 - iPad 2
            Reporter: Christian Hemker
            Assignee: Shazron Abdullah


1. Save a value in window.localStorage after a fresh install of the App in Simulator or iOS Device.
2. Stop the App while running in Background.
3. Restoring the value from window.localStorage is not possible (Error)
4. Save a new value in window.localStorage
5. Stop the App while running in Background.
6. Now you can restore the value (Everything runs fine from now on)

Simple Javascript Test code to reproduce with index.html

<code>
<script type="text/javascript">
            document.addEventListener("deviceready", onDeviceReadyToSave, false);
            
            function onDeviceReadyToSave() {
                
                var item = window.localStorage.getItem("key");
                var message = "deviceready localStorage.getItem('key')="+item+" localStorage.length="+window.localStorage.length;
                
                console.log( message);
                alert(message);
                
                if( item == null){
                    console.log("localStorage.getItem('key') is '"+item+"'");
                    item = "";
                }
                item = item + "value";
                
                window.localStorage.setItem("key", item);
                console.log("calling localStorage.setItem('key', '"+item+"')");
                
                var value = window.localStorage.getItem("key");
                console.log("verified localStorage.getItem('key')="+value);
            }
        </script>

</code>


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (CB-1535) LocalStorage is not saved after first App launch on iOS 6

Posted by "Christian Hemker (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CB-1535?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Christian Hemker updated CB-1535:
---------------------------------

    Description: 
1. Save a value in window.localStorage after a fresh install of the App in Simulator or iOS Device.
2. Stop the App while running in Background.
3. Restart the App and Restoring the value from window.localStorage is not possible (Error)
4. Save a new value in window.localStorage
5. Stop the App while running in Background.
6. Restart the App and now you can restore the value (Everything runs fine from now on)

To reproduce create a sample project with the "create" script.
Put this Javascript into index.html.

The Parameter BackupWebStorage=YES has its default value.

{code}
<script type="text/javascript">
            document.addEventListener("deviceready", onDeviceReadyToSave, false);
            
            function onDeviceReadyToSave() {
                
                var item = window.localStorage.getItem("key");
                var message = "deviceready localStorage.getItem('key')="+item+" localStorage.length="+window.localStorage.length;
                
                console.log( message);
                alert(message);
                
                if( item == null){
                    console.log("localStorage.getItem('key') is '"+item+"'");
                    item = "";
                }
                item = item + "value";
                
                window.localStorage.setItem("key", item);
                console.log("calling localStorage.setItem('key', '"+item+"')");
                
                var value = window.localStorage.getItem("key");
                console.log("verified localStorage.getItem('key')="+value);
            }
        </script>

{code}


  was:
1. Save a value in window.localStorage after a fresh install of the App in Simulator or iOS Device.
2. Stop the App while running in Background.
3. Restoring the value from window.localStorage is not possible (Error)
4. Save a new value in window.localStorage
5. Stop the App while running in Background.
6. Now you can restore the value (Everything runs fine from now on)

Simple Javascript Test code to reproduce with index.html

{code}
<script type="text/javascript">
            document.addEventListener("deviceready", onDeviceReadyToSave, false);
            
            function onDeviceReadyToSave() {
                
                var item = window.localStorage.getItem("key");
                var message = "deviceready localStorage.getItem('key')="+item+" localStorage.length="+window.localStorage.length;
                
                console.log( message);
                alert(message);
                
                if( item == null){
                    console.log("localStorage.getItem('key') is '"+item+"'");
                    item = "";
                }
                item = item + "value";
                
                window.localStorage.setItem("key", item);
                console.log("calling localStorage.setItem('key', '"+item+"')");
                
                var value = window.localStorage.getItem("key");
                console.log("verified localStorage.getItem('key')="+value);
            }
        </script>

{code}


    
> LocalStorage is not saved after first App launch on iOS 6
> ---------------------------------------------------------
>
>                 Key: CB-1535
>                 URL: https://issues.apache.org/jira/browse/CB-1535
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: iOS
>    Affects Versions: 2.1.0
>         Environment: iOS 6.0 - iOS Simulator
> iOS 6.0 - iPad 2
>            Reporter: Christian Hemker
>            Assignee: Shazron Abdullah
>
> 1. Save a value in window.localStorage after a fresh install of the App in Simulator or iOS Device.
> 2. Stop the App while running in Background.
> 3. Restart the App and Restoring the value from window.localStorage is not possible (Error)
> 4. Save a new value in window.localStorage
> 5. Stop the App while running in Background.
> 6. Restart the App and now you can restore the value (Everything runs fine from now on)
> To reproduce create a sample project with the "create" script.
> Put this Javascript into index.html.
> The Parameter BackupWebStorage=YES has its default value.
> {code}
> <script type="text/javascript">
>             document.addEventListener("deviceready", onDeviceReadyToSave, false);
>             
>             function onDeviceReadyToSave() {
>                 
>                 var item = window.localStorage.getItem("key");
>                 var message = "deviceready localStorage.getItem('key')="+item+" localStorage.length="+window.localStorage.length;
>                 
>                 console.log( message);
>                 alert(message);
>                 
>                 if( item == null){
>                     console.log("localStorage.getItem('key') is '"+item+"'");
>                     item = "";
>                 }
>                 item = item + "value";
>                 
>                 window.localStorage.setItem("key", item);
>                 console.log("calling localStorage.setItem('key', '"+item+"')");
>                 
>                 var value = window.localStorage.getItem("key");
>                 console.log("verified localStorage.getItem('key')="+value);
>             }
>         </script>
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CB-1535) LocalStorage is not saved after first App launch on iOS 6

Posted by "Michal Mocny (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-1535?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13463870#comment-13463870 ] 

Michal Mocny commented on CB-1535:
----------------------------------

This should be fixed as of https://git-wip-us.apache.org/repos/asf?p=incubator-cordova-ios.git;a=commit;h=1a6093513c51a817d1ef97ff87cb140519966e4d

Please let me know if it is not.
                
> LocalStorage is not saved after first App launch on iOS 6
> ---------------------------------------------------------
>
>                 Key: CB-1535
>                 URL: https://issues.apache.org/jira/browse/CB-1535
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: iOS
>    Affects Versions: 2.1.0
>         Environment: iOS 6.0 - iOS Simulator
> iOS 6.0 - iPad 2
>            Reporter: Christian Hemker
>            Assignee: Michal Mocny
>         Attachments: index.html
>
>
> 1. Save a value in window.localStorage after a fresh install of the App in Simulator or iOS Device.
> 2. Stop the App while running in Background.
> 3. Restart the App and Restoring the value from window.localStorage is not possible (Error)
> 4. Save a new value in window.localStorage
> 5. Stop the App while running in Background.
> 6. Restart the App and now you can restore the value (Everything runs fine from now on)
> To reproduce create a sample project with the "create" script.
> Put this Javascript into index.html or use the attached index.html.
> The Parameter BackupWebStorage is not changed.
> BackupWebStorage=YES
> {code}
> <script type="text/javascript">
>             document.addEventListener("deviceready", onDeviceReadyToSave, false);
>             
>             function onDeviceReadyToSave() {
>                 
>                 var item = window.localStorage.getItem("key");
>                 var message = "deviceready localStorage.getItem('key')="+item+" localStorage.length="+window.localStorage.length;
>                 
>                 console.log( message);
>                 alert(message);
>                 
>                 if( item == null){
>                     console.log("localStorage.getItem('key') is '"+item+"'");
>                     item = "";
>                 }
>                 item = item + "value";
>                 
>                 window.localStorage.setItem("key", item);
>                 console.log("calling localStorage.setItem('key', '"+item+"')");
>                 
>                 var value = window.localStorage.getItem("key");
>                 console.log("verified localStorage.getItem('key')="+value);
>             }
>         </script>
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (CB-1535) LocalStorage is not saved after first App launch on iOS 6

Posted by "Christian Hemker (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CB-1535?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Christian Hemker updated CB-1535:
---------------------------------

    Attachment: index.html

index.html to reproduce in sample project.
                
> LocalStorage is not saved after first App launch on iOS 6
> ---------------------------------------------------------
>
>                 Key: CB-1535
>                 URL: https://issues.apache.org/jira/browse/CB-1535
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: iOS
>    Affects Versions: 2.1.0
>         Environment: iOS 6.0 - iOS Simulator
> iOS 6.0 - iPad 2
>            Reporter: Christian Hemker
>            Assignee: Shazron Abdullah
>         Attachments: index.html
>
>
> 1. Save a value in window.localStorage after a fresh install of the App in Simulator or iOS Device.
> 2. Stop the App while running in Background.
> 3. Restart the App and Restoring the value from window.localStorage is not possible (Error)
> 4. Save a new value in window.localStorage
> 5. Stop the App while running in Background.
> 6. Restart the App and now you can restore the value (Everything runs fine from now on)
> To reproduce create a sample project with the "create" script.
> Put this Javascript into index.html or use the attached index.html.
> The Parameter BackupWebStorage is not changed.
> BackupWebStorage=YES
> {code}
> <script type="text/javascript">
>             document.addEventListener("deviceready", onDeviceReadyToSave, false);
>             
>             function onDeviceReadyToSave() {
>                 
>                 var item = window.localStorage.getItem("key");
>                 var message = "deviceready localStorage.getItem('key')="+item+" localStorage.length="+window.localStorage.length;
>                 
>                 console.log( message);
>                 alert(message);
>                 
>                 if( item == null){
>                     console.log("localStorage.getItem('key') is '"+item+"'");
>                     item = "";
>                 }
>                 item = item + "value";
>                 
>                 window.localStorage.setItem("key", item);
>                 console.log("calling localStorage.setItem('key', '"+item+"')");
>                 
>                 var value = window.localStorage.getItem("key");
>                 console.log("verified localStorage.getItem('key')="+value);
>             }
>         </script>
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Assigned] (CB-1535) LocalStorage is not saved after first App launch on iOS 6

Posted by "Michal Mocny (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CB-1535?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michal Mocny reassigned CB-1535:
--------------------------------

    Assignee: Michal Mocny  (was: Shazron Abdullah)
    
> LocalStorage is not saved after first App launch on iOS 6
> ---------------------------------------------------------
>
>                 Key: CB-1535
>                 URL: https://issues.apache.org/jira/browse/CB-1535
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: iOS
>    Affects Versions: 2.1.0
>         Environment: iOS 6.0 - iOS Simulator
> iOS 6.0 - iPad 2
>            Reporter: Christian Hemker
>            Assignee: Michal Mocny
>         Attachments: index.html
>
>
> 1. Save a value in window.localStorage after a fresh install of the App in Simulator or iOS Device.
> 2. Stop the App while running in Background.
> 3. Restart the App and Restoring the value from window.localStorage is not possible (Error)
> 4. Save a new value in window.localStorage
> 5. Stop the App while running in Background.
> 6. Restart the App and now you can restore the value (Everything runs fine from now on)
> To reproduce create a sample project with the "create" script.
> Put this Javascript into index.html or use the attached index.html.
> The Parameter BackupWebStorage is not changed.
> BackupWebStorage=YES
> {code}
> <script type="text/javascript">
>             document.addEventListener("deviceready", onDeviceReadyToSave, false);
>             
>             function onDeviceReadyToSave() {
>                 
>                 var item = window.localStorage.getItem("key");
>                 var message = "deviceready localStorage.getItem('key')="+item+" localStorage.length="+window.localStorage.length;
>                 
>                 console.log( message);
>                 alert(message);
>                 
>                 if( item == null){
>                     console.log("localStorage.getItem('key') is '"+item+"'");
>                     item = "";
>                 }
>                 item = item + "value";
>                 
>                 window.localStorage.setItem("key", item);
>                 console.log("calling localStorage.setItem('key', '"+item+"')");
>                 
>                 var value = window.localStorage.getItem("key");
>                 console.log("verified localStorage.getItem('key')="+value);
>             }
>         </script>
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CB-1535) LocalStorage is not saved after first App launch on iOS 6

Posted by "Dewang Shah (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-1535?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13463631#comment-13463631 ] 

Dewang Shah commented on CB-1535:
---------------------------------

I can also confirm that we were seeing the same issue with localStorage not being saved on first run. Christian's solution does fix the problem.

Thanks Christian.
                
> LocalStorage is not saved after first App launch on iOS 6
> ---------------------------------------------------------
>
>                 Key: CB-1535
>                 URL: https://issues.apache.org/jira/browse/CB-1535
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: iOS
>    Affects Versions: 2.1.0
>         Environment: iOS 6.0 - iOS Simulator
> iOS 6.0 - iPad 2
>            Reporter: Christian Hemker
>            Assignee: Shazron Abdullah
>         Attachments: index.html
>
>
> 1. Save a value in window.localStorage after a fresh install of the App in Simulator or iOS Device.
> 2. Stop the App while running in Background.
> 3. Restart the App and Restoring the value from window.localStorage is not possible (Error)
> 4. Save a new value in window.localStorage
> 5. Stop the App while running in Background.
> 6. Restart the App and now you can restore the value (Everything runs fine from now on)
> To reproduce create a sample project with the "create" script.
> Put this Javascript into index.html or use the attached index.html.
> The Parameter BackupWebStorage is not changed.
> BackupWebStorage=YES
> {code}
> <script type="text/javascript">
>             document.addEventListener("deviceready", onDeviceReadyToSave, false);
>             
>             function onDeviceReadyToSave() {
>                 
>                 var item = window.localStorage.getItem("key");
>                 var message = "deviceready localStorage.getItem('key')="+item+" localStorage.length="+window.localStorage.length;
>                 
>                 console.log( message);
>                 alert(message);
>                 
>                 if( item == null){
>                     console.log("localStorage.getItem('key') is '"+item+"'");
>                     item = "";
>                 }
>                 item = item + "value";
>                 
>                 window.localStorage.setItem("key", item);
>                 console.log("calling localStorage.setItem('key', '"+item+"')");
>                 
>                 var value = window.localStorage.getItem("key");
>                 console.log("verified localStorage.getItem('key')="+value);
>             }
>         </script>
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CB-1535) LocalStorage is not saved after first App launch on iOS 6

Posted by "Michal Mocny (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-1535?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13465683#comment-13465683 ] 

Michal Mocny commented on CB-1535:
----------------------------------

Lee, thanks for mentioning, I'm filing a new issue for this.
                
> LocalStorage is not saved after first App launch on iOS 6
> ---------------------------------------------------------
>
>                 Key: CB-1535
>                 URL: https://issues.apache.org/jira/browse/CB-1535
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: iOS
>    Affects Versions: 2.1.0
>         Environment: iOS 6.0 - iOS Simulator
> iOS 6.0 - iPad 2
>            Reporter: Christian Hemker
>            Assignee: Michal Mocny
>         Attachments: index.html
>
>
> 1. Save a value in window.localStorage after a fresh install of the App in Simulator or iOS Device.
> 2. Stop the App while running in Background.
> 3. Restart the App and Restoring the value from window.localStorage is not possible (Error)
> 4. Save a new value in window.localStorage
> 5. Stop the App while running in Background.
> 6. Restart the App and now you can restore the value (Everything runs fine from now on)
> To reproduce create a sample project with the "create" script.
> Put this Javascript into index.html or use the attached index.html.
> The Parameter BackupWebStorage is not changed.
> BackupWebStorage=YES
> {code}
> <script type="text/javascript">
>             document.addEventListener("deviceready", onDeviceReadyToSave, false);
>             
>             function onDeviceReadyToSave() {
>                 
>                 var item = window.localStorage.getItem("key");
>                 var message = "deviceready localStorage.getItem('key')="+item+" localStorage.length="+window.localStorage.length;
>                 
>                 console.log( message);
>                 alert(message);
>                 
>                 if( item == null){
>                     console.log("localStorage.getItem('key') is '"+item+"'");
>                     item = "";
>                 }
>                 item = item + "value";
>                 
>                 window.localStorage.setItem("key", item);
>                 console.log("calling localStorage.setItem('key', '"+item+"')");
>                 
>                 var value = window.localStorage.getItem("key");
>                 console.log("verified localStorage.getItem('key')="+value);
>             }
>         </script>
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CB-1535) LocalStorage is not saved after first App launch on iOS 6

Posted by "Lee Crossley (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-1535?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13465621#comment-13465621 ] 

Lee Crossley commented on CB-1535:
----------------------------------

I have been testing the fix and found a problem. Here are the steps:

1. A webdatabase is created by an App built with the iOS5 SDK and an earlier version of Cordova.

2. The App is updated to use Cordova 2.1 (with the above fix) and built with the iOS6 SDK.

3. Updating the app from 1 to 2 loses the webdatabase.

I imagine this will be a common upgrade for most users.
                
> LocalStorage is not saved after first App launch on iOS 6
> ---------------------------------------------------------
>
>                 Key: CB-1535
>                 URL: https://issues.apache.org/jira/browse/CB-1535
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: iOS
>    Affects Versions: 2.1.0
>         Environment: iOS 6.0 - iOS Simulator
> iOS 6.0 - iPad 2
>            Reporter: Christian Hemker
>            Assignee: Michal Mocny
>         Attachments: index.html
>
>
> 1. Save a value in window.localStorage after a fresh install of the App in Simulator or iOS Device.
> 2. Stop the App while running in Background.
> 3. Restart the App and Restoring the value from window.localStorage is not possible (Error)
> 4. Save a new value in window.localStorage
> 5. Stop the App while running in Background.
> 6. Restart the App and now you can restore the value (Everything runs fine from now on)
> To reproduce create a sample project with the "create" script.
> Put this Javascript into index.html or use the attached index.html.
> The Parameter BackupWebStorage is not changed.
> BackupWebStorage=YES
> {code}
> <script type="text/javascript">
>             document.addEventListener("deviceready", onDeviceReadyToSave, false);
>             
>             function onDeviceReadyToSave() {
>                 
>                 var item = window.localStorage.getItem("key");
>                 var message = "deviceready localStorage.getItem('key')="+item+" localStorage.length="+window.localStorage.length;
>                 
>                 console.log( message);
>                 alert(message);
>                 
>                 if( item == null){
>                     console.log("localStorage.getItem('key') is '"+item+"'");
>                     item = "";
>                 }
>                 item = item + "value";
>                 
>                 window.localStorage.setItem("key", item);
>                 console.log("calling localStorage.setItem('key', '"+item+"')");
>                 
>                 var value = window.localStorage.getItem("key");
>                 console.log("verified localStorage.getItem('key')="+value);
>             }
>         </script>
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CB-1535) LocalStorage is not saved after first App launch on iOS 6

Posted by "Christian Kuetbach (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-1535?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13462915#comment-13462915 ] 

Christian Kuetbach commented on CB-1535:
----------------------------------------

I think I have an idea, why this happens:

The first time, the app loads the localStorage is not persistent. The flag will be set by cordova. The localStorage is loaded from the cache folder. Everything will be stored in the files located in that folder.

>From the second time forward the localStorage is loaded from another (persitent) folder. All changes are stored there.


                
> LocalStorage is not saved after first App launch on iOS 6
> ---------------------------------------------------------
>
>                 Key: CB-1535
>                 URL: https://issues.apache.org/jira/browse/CB-1535
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: iOS
>    Affects Versions: 2.1.0
>         Environment: iOS 6.0 - iOS Simulator
> iOS 6.0 - iPad 2
>            Reporter: Christian Hemker
>            Assignee: Shazron Abdullah
>         Attachments: index.html
>
>
> 1. Save a value in window.localStorage after a fresh install of the App in Simulator or iOS Device.
> 2. Stop the App while running in Background.
> 3. Restart the App and Restoring the value from window.localStorage is not possible (Error)
> 4. Save a new value in window.localStorage
> 5. Stop the App while running in Background.
> 6. Restart the App and now you can restore the value (Everything runs fine from now on)
> To reproduce create a sample project with the "create" script.
> Put this Javascript into index.html or use the attached index.html.
> The Parameter BackupWebStorage is not changed.
> BackupWebStorage=YES
> {code}
> <script type="text/javascript">
>             document.addEventListener("deviceready", onDeviceReadyToSave, false);
>             
>             function onDeviceReadyToSave() {
>                 
>                 var item = window.localStorage.getItem("key");
>                 var message = "deviceready localStorage.getItem('key')="+item+" localStorage.length="+window.localStorage.length;
>                 
>                 console.log( message);
>                 alert(message);
>                 
>                 if( item == null){
>                     console.log("localStorage.getItem('key') is '"+item+"'");
>                     item = "";
>                 }
>                 item = item + "value";
>                 
>                 window.localStorage.setItem("key", item);
>                 console.log("calling localStorage.setItem('key', '"+item+"')");
>                 
>                 var value = window.localStorage.getItem("key");
>                 console.log("verified localStorage.getItem('key')="+value);
>             }
>         </script>
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CB-1535) LocalStorage is not saved after first App launch on iOS 6

Posted by "Michal Mocny (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-1535?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13463843#comment-13463843 ] 

Michal Mocny commented on CB-1535:
----------------------------------

I'm working to get this landed, just working on verifying the solution now.
                
> LocalStorage is not saved after first App launch on iOS 6
> ---------------------------------------------------------
>
>                 Key: CB-1535
>                 URL: https://issues.apache.org/jira/browse/CB-1535
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: iOS
>    Affects Versions: 2.1.0
>         Environment: iOS 6.0 - iOS Simulator
> iOS 6.0 - iPad 2
>            Reporter: Christian Hemker
>            Assignee: Shazron Abdullah
>         Attachments: index.html
>
>
> 1. Save a value in window.localStorage after a fresh install of the App in Simulator or iOS Device.
> 2. Stop the App while running in Background.
> 3. Restart the App and Restoring the value from window.localStorage is not possible (Error)
> 4. Save a new value in window.localStorage
> 5. Stop the App while running in Background.
> 6. Restart the App and now you can restore the value (Everything runs fine from now on)
> To reproduce create a sample project with the "create" script.
> Put this Javascript into index.html or use the attached index.html.
> The Parameter BackupWebStorage is not changed.
> BackupWebStorage=YES
> {code}
> <script type="text/javascript">
>             document.addEventListener("deviceready", onDeviceReadyToSave, false);
>             
>             function onDeviceReadyToSave() {
>                 
>                 var item = window.localStorage.getItem("key");
>                 var message = "deviceready localStorage.getItem('key')="+item+" localStorage.length="+window.localStorage.length;
>                 
>                 console.log( message);
>                 alert(message);
>                 
>                 if( item == null){
>                     console.log("localStorage.getItem('key') is '"+item+"'");
>                     item = "";
>                 }
>                 item = item + "value";
>                 
>                 window.localStorage.setItem("key", item);
>                 console.log("calling localStorage.setItem('key', '"+item+"')");
>                 
>                 var value = window.localStorage.getItem("key");
>                 console.log("verified localStorage.getItem('key')="+value);
>             }
>         </script>
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Comment Edited] (CB-1535) LocalStorage is not saved after first App launch on iOS 6

Posted by "Christian Hemker (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-1535?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13463850#comment-13463850 ] 

Christian Hemker edited comment on CB-1535 at 9/27/12 1:25 AM:
---------------------------------------------------------------

To get it working correct for iOS 6 
I moved also the call to restore from Backup Locations before instantiate UIWebView

{code:title=CDVViewController.m Line 201-205}
    if (IsAtLeastiOSVersion(@"6.0")) {
        [CDVLocalStorage __restoreThenRemoveBackupLocations];
        [[NSUserDefaults standardUserDefaults] setBool:backupWebStorage forKey:@"WebKitStoreWebDataForBackup"];
    }
    // // Instantiate the WebView ///////////////
    [self createGapView];
{code}

And changed the following if statement

{code:title=CDVViewController.m Line 232}
    if (!IsAtLeastiOSVersion(@"6.0")) {
        if (backupWebStorage) {
            [self.commandDelegate registerPlugin:[[CDVLocalStorage alloc] initWithWebView:self.webView] withClassName:NSStringFromClass([CDVLocalStorage class])];
        } else {
            [CDVLocalStorage __restoreThenRemoveBackupLocations];
        }
    }
{code}

                
      was (Author: chemm):
    To get it working correct for iOS 6 
I moved also the call to restore from Backup Locations before instantiate UIWebView

{code:title CDVViewController.m Line 201-205}
    if (IsAtLeastiOSVersion(@"6.0")) {
        [CDVLocalStorage __restoreThenRemoveBackupLocations];
        [[NSUserDefaults standardUserDefaults] setBool:backupWebStorage forKey:@"WebKitStoreWebDataForBackup"];
    }
    // // Instantiate the WebView ///////////////
    [self createGapView];
{code}

And changed the following if statement

{code:title CDVViewController.m Line 232}
    if (!IsAtLeastiOSVersion(@"6.0")) {
        if (backupWebStorage) {
            [self.commandDelegate registerPlugin:[[CDVLocalStorage alloc] initWithWebView:self.webView] withClassName:NSStringFromClass([CDVLocalStorage class])];
        } else {
            [CDVLocalStorage __restoreThenRemoveBackupLocations];
        }
    }
{code}

                  
> LocalStorage is not saved after first App launch on iOS 6
> ---------------------------------------------------------
>
>                 Key: CB-1535
>                 URL: https://issues.apache.org/jira/browse/CB-1535
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: iOS
>    Affects Versions: 2.1.0
>         Environment: iOS 6.0 - iOS Simulator
> iOS 6.0 - iPad 2
>            Reporter: Christian Hemker
>            Assignee: Michal Mocny
>         Attachments: index.html
>
>
> 1. Save a value in window.localStorage after a fresh install of the App in Simulator or iOS Device.
> 2. Stop the App while running in Background.
> 3. Restart the App and Restoring the value from window.localStorage is not possible (Error)
> 4. Save a new value in window.localStorage
> 5. Stop the App while running in Background.
> 6. Restart the App and now you can restore the value (Everything runs fine from now on)
> To reproduce create a sample project with the "create" script.
> Put this Javascript into index.html or use the attached index.html.
> The Parameter BackupWebStorage is not changed.
> BackupWebStorage=YES
> {code}
> <script type="text/javascript">
>             document.addEventListener("deviceready", onDeviceReadyToSave, false);
>             
>             function onDeviceReadyToSave() {
>                 
>                 var item = window.localStorage.getItem("key");
>                 var message = "deviceready localStorage.getItem('key')="+item+" localStorage.length="+window.localStorage.length;
>                 
>                 console.log( message);
>                 alert(message);
>                 
>                 if( item == null){
>                     console.log("localStorage.getItem('key') is '"+item+"'");
>                     item = "";
>                 }
>                 item = item + "value";
>                 
>                 window.localStorage.setItem("key", item);
>                 console.log("calling localStorage.setItem('key', '"+item+"')");
>                 
>                 var value = window.localStorage.getItem("key");
>                 console.log("verified localStorage.getItem('key')="+value);
>             }
>         </script>
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CB-1535) LocalStorage is not saved after first App launch on iOS 6

Posted by "Christian Hemker (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-1535?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13463233#comment-13463233 ] 

Christian Hemker commented on CB-1535:
--------------------------------------

The problem is the UIWebView is created earlier than the new Key WebKitStoreWebDataForBackup is set with NSUserDefault.
If I set the Key WebKitStoreWebDataForBackup before the UIWebView is created everything seems to run correct.
With this change the localStorage is saved during restart of the app.


{code:title=CDVViewController.m Line 204}
if (IsAtLeastiOSVersion(@"6.0")) {
        [[NSUserDefaults standardUserDefaults] setBool:backupWebStorage forKey:@"WebKitStoreWebDataForBackup"];
}
//// Instantiate the WebView ///////////////
[self createGapView];
{code}

                
> LocalStorage is not saved after first App launch on iOS 6
> ---------------------------------------------------------
>
>                 Key: CB-1535
>                 URL: https://issues.apache.org/jira/browse/CB-1535
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: iOS
>    Affects Versions: 2.1.0
>         Environment: iOS 6.0 - iOS Simulator
> iOS 6.0 - iPad 2
>            Reporter: Christian Hemker
>            Assignee: Shazron Abdullah
>         Attachments: index.html
>
>
> 1. Save a value in window.localStorage after a fresh install of the App in Simulator or iOS Device.
> 2. Stop the App while running in Background.
> 3. Restart the App and Restoring the value from window.localStorage is not possible (Error)
> 4. Save a new value in window.localStorage
> 5. Stop the App while running in Background.
> 6. Restart the App and now you can restore the value (Everything runs fine from now on)
> To reproduce create a sample project with the "create" script.
> Put this Javascript into index.html or use the attached index.html.
> The Parameter BackupWebStorage is not changed.
> BackupWebStorage=YES
> {code}
> <script type="text/javascript">
>             document.addEventListener("deviceready", onDeviceReadyToSave, false);
>             
>             function onDeviceReadyToSave() {
>                 
>                 var item = window.localStorage.getItem("key");
>                 var message = "deviceready localStorage.getItem('key')="+item+" localStorage.length="+window.localStorage.length;
>                 
>                 console.log( message);
>                 alert(message);
>                 
>                 if( item == null){
>                     console.log("localStorage.getItem('key') is '"+item+"'");
>                     item = "";
>                 }
>                 item = item + "value";
>                 
>                 window.localStorage.setItem("key", item);
>                 console.log("calling localStorage.setItem('key', '"+item+"')");
>                 
>                 var value = window.localStorage.getItem("key");
>                 console.log("verified localStorage.getItem('key')="+value);
>             }
>         </script>
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (CB-1535) LocalStorage is not saved after first App launch on iOS 6

Posted by "Christian Hemker (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CB-1535?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Christian Hemker updated CB-1535:
---------------------------------

    Description: 
1. Save a value in window.localStorage after a fresh install of the App in Simulator or iOS Device.
2. Stop the App while running in Background.
3. Restart the App and Restoring the value from window.localStorage is not possible (Error)
4. Save a new value in window.localStorage
5. Stop the App while running in Background.
6. Restart the App and now you can restore the value (Everything runs fine from now on)

To reproduce create a sample project with the "create" script.
Put this Javascript into index.html or use the attached index.html.

The Parameter BackupWebStorage is not changed.
BackupWebStorage=YES


{code}
<script type="text/javascript">
            document.addEventListener("deviceready", onDeviceReadyToSave, false);
            
            function onDeviceReadyToSave() {
                
                var item = window.localStorage.getItem("key");
                var message = "deviceready localStorage.getItem('key')="+item+" localStorage.length="+window.localStorage.length;
                
                console.log( message);
                alert(message);
                
                if( item == null){
                    console.log("localStorage.getItem('key') is '"+item+"'");
                    item = "";
                }
                item = item + "value";
                
                window.localStorage.setItem("key", item);
                console.log("calling localStorage.setItem('key', '"+item+"')");
                
                var value = window.localStorage.getItem("key");
                console.log("verified localStorage.getItem('key')="+value);
            }
        </script>

{code}


  was:
1. Save a value in window.localStorage after a fresh install of the App in Simulator or iOS Device.
2. Stop the App while running in Background.
3. Restart the App and Restoring the value from window.localStorage is not possible (Error)
4. Save a new value in window.localStorage
5. Stop the App while running in Background.
6. Restart the App and now you can restore the value (Everything runs fine from now on)

To reproduce create a sample project with the "create" script.
Put this Javascript into index.html.

The Parameter BackupWebStorage=YES has its default value.

{code}
<script type="text/javascript">
            document.addEventListener("deviceready", onDeviceReadyToSave, false);
            
            function onDeviceReadyToSave() {
                
                var item = window.localStorage.getItem("key");
                var message = "deviceready localStorage.getItem('key')="+item+" localStorage.length="+window.localStorage.length;
                
                console.log( message);
                alert(message);
                
                if( item == null){
                    console.log("localStorage.getItem('key') is '"+item+"'");
                    item = "";
                }
                item = item + "value";
                
                window.localStorage.setItem("key", item);
                console.log("calling localStorage.setItem('key', '"+item+"')");
                
                var value = window.localStorage.getItem("key");
                console.log("verified localStorage.getItem('key')="+value);
            }
        </script>

{code}


    
> LocalStorage is not saved after first App launch on iOS 6
> ---------------------------------------------------------
>
>                 Key: CB-1535
>                 URL: https://issues.apache.org/jira/browse/CB-1535
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: iOS
>    Affects Versions: 2.1.0
>         Environment: iOS 6.0 - iOS Simulator
> iOS 6.0 - iPad 2
>            Reporter: Christian Hemker
>            Assignee: Shazron Abdullah
>         Attachments: index.html
>
>
> 1. Save a value in window.localStorage after a fresh install of the App in Simulator or iOS Device.
> 2. Stop the App while running in Background.
> 3. Restart the App and Restoring the value from window.localStorage is not possible (Error)
> 4. Save a new value in window.localStorage
> 5. Stop the App while running in Background.
> 6. Restart the App and now you can restore the value (Everything runs fine from now on)
> To reproduce create a sample project with the "create" script.
> Put this Javascript into index.html or use the attached index.html.
> The Parameter BackupWebStorage is not changed.
> BackupWebStorage=YES
> {code}
> <script type="text/javascript">
>             document.addEventListener("deviceready", onDeviceReadyToSave, false);
>             
>             function onDeviceReadyToSave() {
>                 
>                 var item = window.localStorage.getItem("key");
>                 var message = "deviceready localStorage.getItem('key')="+item+" localStorage.length="+window.localStorage.length;
>                 
>                 console.log( message);
>                 alert(message);
>                 
>                 if( item == null){
>                     console.log("localStorage.getItem('key') is '"+item+"'");
>                     item = "";
>                 }
>                 item = item + "value";
>                 
>                 window.localStorage.setItem("key", item);
>                 console.log("calling localStorage.setItem('key', '"+item+"')");
>                 
>                 var value = window.localStorage.getItem("key");
>                 console.log("verified localStorage.getItem('key')="+value);
>             }
>         </script>
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CB-1535) LocalStorage is not saved after first App launch on iOS 6

Posted by "Christian Hemker (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-1535?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13463850#comment-13463850 ] 

Christian Hemker commented on CB-1535:
--------------------------------------

To get it working correct for iOS 6 
I moved also the call to restore from Backup Locations before instantiate UIWebView

{code:title CDVViewController.m Line 201-205}
    if (IsAtLeastiOSVersion(@"6.0")) {
        [CDVLocalStorage __restoreThenRemoveBackupLocations];
        [[NSUserDefaults standardUserDefaults] setBool:backupWebStorage forKey:@"WebKitStoreWebDataForBackup"];
    }
    // // Instantiate the WebView ///////////////
    [self createGapView];
{code}

And changed the following if statement

{code:title CDVViewController.m Line 232}
    if (!IsAtLeastiOSVersion(@"6.0")) {
        if (backupWebStorage) {
            [self.commandDelegate registerPlugin:[[CDVLocalStorage alloc] initWithWebView:self.webView] withClassName:NSStringFromClass([CDVLocalStorage class])];
        } else {
            [CDVLocalStorage __restoreThenRemoveBackupLocations];
        }
    }
{code}

                
> LocalStorage is not saved after first App launch on iOS 6
> ---------------------------------------------------------
>
>                 Key: CB-1535
>                 URL: https://issues.apache.org/jira/browse/CB-1535
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: iOS
>    Affects Versions: 2.1.0
>         Environment: iOS 6.0 - iOS Simulator
> iOS 6.0 - iPad 2
>            Reporter: Christian Hemker
>            Assignee: Michal Mocny
>         Attachments: index.html
>
>
> 1. Save a value in window.localStorage after a fresh install of the App in Simulator or iOS Device.
> 2. Stop the App while running in Background.
> 3. Restart the App and Restoring the value from window.localStorage is not possible (Error)
> 4. Save a new value in window.localStorage
> 5. Stop the App while running in Background.
> 6. Restart the App and now you can restore the value (Everything runs fine from now on)
> To reproduce create a sample project with the "create" script.
> Put this Javascript into index.html or use the attached index.html.
> The Parameter BackupWebStorage is not changed.
> BackupWebStorage=YES
> {code}
> <script type="text/javascript">
>             document.addEventListener("deviceready", onDeviceReadyToSave, false);
>             
>             function onDeviceReadyToSave() {
>                 
>                 var item = window.localStorage.getItem("key");
>                 var message = "deviceready localStorage.getItem('key')="+item+" localStorage.length="+window.localStorage.length;
>                 
>                 console.log( message);
>                 alert(message);
>                 
>                 if( item == null){
>                     console.log("localStorage.getItem('key') is '"+item+"'");
>                     item = "";
>                 }
>                 item = item + "value";
>                 
>                 window.localStorage.setItem("key", item);
>                 console.log("calling localStorage.setItem('key', '"+item+"')");
>                 
>                 var value = window.localStorage.getItem("key");
>                 console.log("verified localStorage.getItem('key')="+value);
>             }
>         </script>
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (CB-1535) LocalStorage is not saved after first App launch on iOS 6

Posted by "Christian Hemker (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CB-1535?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Christian Hemker updated CB-1535:
---------------------------------

    Description: 
1. Save a value in window.localStorage after a fresh install of the App in Simulator or iOS Device.
2. Stop the App while running in Background.
3. Restoring the value from window.localStorage is not possible (Error)
4. Save a new value in window.localStorage
5. Stop the App while running in Background.
6. Now you can restore the value (Everything runs fine from now on)

Simple Javascript Test code to reproduce with index.html

{code}
<script type="text/javascript">
            document.addEventListener("deviceready", onDeviceReadyToSave, false);
            
            function onDeviceReadyToSave() {
                
                var item = window.localStorage.getItem("key");
                var message = "deviceready localStorage.getItem('key')="+item+" localStorage.length="+window.localStorage.length;
                
                console.log( message);
                alert(message);
                
                if( item == null){
                    console.log("localStorage.getItem('key') is '"+item+"'");
                    item = "";
                }
                item = item + "value";
                
                window.localStorage.setItem("key", item);
                console.log("calling localStorage.setItem('key', '"+item+"')");
                
                var value = window.localStorage.getItem("key");
                console.log("verified localStorage.getItem('key')="+value);
            }
        </script>

{code}


  was:
1. Save a value in window.localStorage after a fresh install of the App in Simulator or iOS Device.
2. Stop the App while running in Background.
3. Restoring the value from window.localStorage is not possible (Error)
4. Save a new value in window.localStorage
5. Stop the App while running in Background.
6. Now you can restore the value (Everything runs fine from now on)

Simple Javascript Test code to reproduce with index.html

<code>
<script type="text/javascript">
            document.addEventListener("deviceready", onDeviceReadyToSave, false);
            
            function onDeviceReadyToSave() {
                
                var item = window.localStorage.getItem("key");
                var message = "deviceready localStorage.getItem('key')="+item+" localStorage.length="+window.localStorage.length;
                
                console.log( message);
                alert(message);
                
                if( item == null){
                    console.log("localStorage.getItem('key') is '"+item+"'");
                    item = "";
                }
                item = item + "value";
                
                window.localStorage.setItem("key", item);
                console.log("calling localStorage.setItem('key', '"+item+"')");
                
                var value = window.localStorage.getItem("key");
                console.log("verified localStorage.getItem('key')="+value);
            }
        </script>

</code>


    
> LocalStorage is not saved after first App launch on iOS 6
> ---------------------------------------------------------
>
>                 Key: CB-1535
>                 URL: https://issues.apache.org/jira/browse/CB-1535
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: iOS
>    Affects Versions: 2.1.0
>         Environment: iOS 6.0 - iOS Simulator
> iOS 6.0 - iPad 2
>            Reporter: Christian Hemker
>            Assignee: Shazron Abdullah
>
> 1. Save a value in window.localStorage after a fresh install of the App in Simulator or iOS Device.
> 2. Stop the App while running in Background.
> 3. Restoring the value from window.localStorage is not possible (Error)
> 4. Save a new value in window.localStorage
> 5. Stop the App while running in Background.
> 6. Now you can restore the value (Everything runs fine from now on)
> Simple Javascript Test code to reproduce with index.html
> {code}
> <script type="text/javascript">
>             document.addEventListener("deviceready", onDeviceReadyToSave, false);
>             
>             function onDeviceReadyToSave() {
>                 
>                 var item = window.localStorage.getItem("key");
>                 var message = "deviceready localStorage.getItem('key')="+item+" localStorage.length="+window.localStorage.length;
>                 
>                 console.log( message);
>                 alert(message);
>                 
>                 if( item == null){
>                     console.log("localStorage.getItem('key') is '"+item+"'");
>                     item = "";
>                 }
>                 item = item + "value";
>                 
>                 window.localStorage.setItem("key", item);
>                 console.log("calling localStorage.setItem('key', '"+item+"')");
>                 
>                 var value = window.localStorage.getItem("key");
>                 console.log("verified localStorage.getItem('key')="+value);
>             }
>         </script>
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Resolved] (CB-1535) LocalStorage is not saved after first App launch on iOS 6

Posted by "Michal Mocny (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CB-1535?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michal Mocny resolved CB-1535.
------------------------------

    Resolution: Fixed
    
> LocalStorage is not saved after first App launch on iOS 6
> ---------------------------------------------------------
>
>                 Key: CB-1535
>                 URL: https://issues.apache.org/jira/browse/CB-1535
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: iOS
>    Affects Versions: 2.1.0
>         Environment: iOS 6.0 - iOS Simulator
> iOS 6.0 - iPad 2
>            Reporter: Christian Hemker
>            Assignee: Michal Mocny
>         Attachments: index.html
>
>
> 1. Save a value in window.localStorage after a fresh install of the App in Simulator or iOS Device.
> 2. Stop the App while running in Background.
> 3. Restart the App and Restoring the value from window.localStorage is not possible (Error)
> 4. Save a new value in window.localStorage
> 5. Stop the App while running in Background.
> 6. Restart the App and now you can restore the value (Everything runs fine from now on)
> To reproduce create a sample project with the "create" script.
> Put this Javascript into index.html or use the attached index.html.
> The Parameter BackupWebStorage is not changed.
> BackupWebStorage=YES
> {code}
> <script type="text/javascript">
>             document.addEventListener("deviceready", onDeviceReadyToSave, false);
>             
>             function onDeviceReadyToSave() {
>                 
>                 var item = window.localStorage.getItem("key");
>                 var message = "deviceready localStorage.getItem('key')="+item+" localStorage.length="+window.localStorage.length;
>                 
>                 console.log( message);
>                 alert(message);
>                 
>                 if( item == null){
>                     console.log("localStorage.getItem('key') is '"+item+"'");
>                     item = "";
>                 }
>                 item = item + "value";
>                 
>                 window.localStorage.setItem("key", item);
>                 console.log("calling localStorage.setItem('key', '"+item+"')");
>                 
>                 var value = window.localStorage.getItem("key");
>                 console.log("verified localStorage.getItem('key')="+value);
>             }
>         </script>
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CB-1535) LocalStorage is not saved after first App launch on iOS 6

Posted by "Michal Mocny (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-1535?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13465684#comment-13465684 ] 

Michal Mocny commented on CB-1535:
----------------------------------

https://issues.apache.org/jira/browse/CB-1558
                
> LocalStorage is not saved after first App launch on iOS 6
> ---------------------------------------------------------
>
>                 Key: CB-1535
>                 URL: https://issues.apache.org/jira/browse/CB-1535
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: iOS
>    Affects Versions: 2.1.0
>         Environment: iOS 6.0 - iOS Simulator
> iOS 6.0 - iPad 2
>            Reporter: Christian Hemker
>            Assignee: Michal Mocny
>         Attachments: index.html
>
>
> 1. Save a value in window.localStorage after a fresh install of the App in Simulator or iOS Device.
> 2. Stop the App while running in Background.
> 3. Restart the App and Restoring the value from window.localStorage is not possible (Error)
> 4. Save a new value in window.localStorage
> 5. Stop the App while running in Background.
> 6. Restart the App and now you can restore the value (Everything runs fine from now on)
> To reproduce create a sample project with the "create" script.
> Put this Javascript into index.html or use the attached index.html.
> The Parameter BackupWebStorage is not changed.
> BackupWebStorage=YES
> {code}
> <script type="text/javascript">
>             document.addEventListener("deviceready", onDeviceReadyToSave, false);
>             
>             function onDeviceReadyToSave() {
>                 
>                 var item = window.localStorage.getItem("key");
>                 var message = "deviceready localStorage.getItem('key')="+item+" localStorage.length="+window.localStorage.length;
>                 
>                 console.log( message);
>                 alert(message);
>                 
>                 if( item == null){
>                     console.log("localStorage.getItem('key') is '"+item+"'");
>                     item = "";
>                 }
>                 item = item + "value";
>                 
>                 window.localStorage.setItem("key", item);
>                 console.log("calling localStorage.setItem('key', '"+item+"')");
>                 
>                 var value = window.localStorage.getItem("key");
>                 console.log("verified localStorage.getItem('key')="+value);
>             }
>         </script>
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CB-1535) LocalStorage is not saved after first App launch on iOS 6

Posted by "Ben BIrch (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-1535?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13463407#comment-13463407 ] 

Ben BIrch commented on CB-1535:
-------------------------------

We noticed several regressions between iOS5 and iOS6 with localStorage integrity. Can confirm that the fix above works.
                
> LocalStorage is not saved after first App launch on iOS 6
> ---------------------------------------------------------
>
>                 Key: CB-1535
>                 URL: https://issues.apache.org/jira/browse/CB-1535
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: iOS
>    Affects Versions: 2.1.0
>         Environment: iOS 6.0 - iOS Simulator
> iOS 6.0 - iPad 2
>            Reporter: Christian Hemker
>            Assignee: Shazron Abdullah
>         Attachments: index.html
>
>
> 1. Save a value in window.localStorage after a fresh install of the App in Simulator or iOS Device.
> 2. Stop the App while running in Background.
> 3. Restart the App and Restoring the value from window.localStorage is not possible (Error)
> 4. Save a new value in window.localStorage
> 5. Stop the App while running in Background.
> 6. Restart the App and now you can restore the value (Everything runs fine from now on)
> To reproduce create a sample project with the "create" script.
> Put this Javascript into index.html or use the attached index.html.
> The Parameter BackupWebStorage is not changed.
> BackupWebStorage=YES
> {code}
> <script type="text/javascript">
>             document.addEventListener("deviceready", onDeviceReadyToSave, false);
>             
>             function onDeviceReadyToSave() {
>                 
>                 var item = window.localStorage.getItem("key");
>                 var message = "deviceready localStorage.getItem('key')="+item+" localStorage.length="+window.localStorage.length;
>                 
>                 console.log( message);
>                 alert(message);
>                 
>                 if( item == null){
>                     console.log("localStorage.getItem('key') is '"+item+"'");
>                     item = "";
>                 }
>                 item = item + "value";
>                 
>                 window.localStorage.setItem("key", item);
>                 console.log("calling localStorage.setItem('key', '"+item+"')");
>                 
>                 var value = window.localStorage.getItem("key");
>                 console.log("verified localStorage.getItem('key')="+value);
>             }
>         </script>
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira