cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nikhil Khandelwal (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CB-10529) localstorage not persistent on device
Date Mon, 08 Feb 2016 18:04:39 GMT

    [ https://issues.apache.org/jira/browse/CB-10529?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15137371#comment-15137371
] 

Nikhil Khandelwal commented on CB-10529:
----------------------------------------

I think in Android we ended up uninstalling and installing the app on every `cordova run`
and I have heard reports of that causing an issue.

> localstorage not persistent on device
> -------------------------------------
>
>                 Key: CB-10529
>                 URL: https://issues.apache.org/jira/browse/CB-10529
>             Project: Apache Cordova
>          Issue Type: Bug
>    Affects Versions: 6.0.0
>            Reporter: Maik Schindler
>
> I write a value into the localstorage.
> After restarting the app getItem will return null.
> <code>
> <!DOCTYPE html>
> <html>
> <head>
>     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
>     <meta charset="utf-8" />
>     <!--
>         Passen Sie die Inhaltssicherheitsrichtlinie im META-Tag unten nach Bedarf an.
Fügen Sie "default-src" die Option "unsafe-inline" hinzu, um Inline-JavaScript zu aktivieren.
>         Details finden Sie unter "http://go.microsoft.com/fwlink/?LinkID=617521".
>     <meta http-equiv="Content-Security-Policy" content="default-src 'self' data: gap:
https://ssl.gstatic.com 'unsafe-eval'; style-src 'self' 'unsafe-inline'; media-src *">
>         -->
>     <meta http-equiv="Content-Security-Policy" content="default-src * data: gap: https://ssl.gstatic.com
'unsafe-eval'; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' 'unsafe-eval';
media-src *">
>     <title>Test</title>
>     <!-- MediaTest-Verweise -->
>     <link href="css/index.css" rel="stylesheet" />
>     <!-- Cordova-Verweis, wird Ihrer App beim Erstellen hinzugefügt. -->
>     <script src="cordova.js"></script>
>     <script src="scripts/platformOverrides.js"></script>
>     <script src="scripts/index.js"></script>
>     
>     <script src="scripts/jquery-2.1.4.min.js"></script>
>     <script src="scripts/jquery.mobile-1.4.5.min.js"></script>
> </head>
> <body>
>     <p>Hello, App is ready!</p>
>     <button id="Write">Write</button>
>     <button id="Read">Read</button>
>     <script>
>         $(document).ready(function () {
>             
>             $('#Write').on("tap", function () {
>                 window.localStorage.setItem("Test", "Value");
>                 console.log("Test Value written");
>             });
>             $('#Read').on("tap", function () {
>                 console.log("Read Test "+window.localStorage.getItem("Test"));
>             });
>         });
>     </script>
> </body>
> </html>
> </code>



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


Mime
View raw message