gerhardsletten edited a comment on issue #906:
URL: https://github.com/apache/cordova-ios/issues/906#issuecomment-672692414


   @jcesarmobile 
   
   > You can keep using file protocol if you don't configure the scheme and 
your data will still be there. If you set the scheme then data won't be 
accessible as the url changes (not lost, the data is still there).
   
   For a regular cordova app, this is not correct, at least for localstorage. 
After what I can see cordova-ios-6.x will create new files to store 
localstorage, I inspected the filesystem for the simulator.
   
   The original name of the localstorage-file seems to be 
`WebKit/LocalStorage/file__0.localstorage`, while the new name will depends on 
the scheme and hostname set in config.xm, so if you set 
   
   ```
   <preference name="scheme" value="app" />
   <preference name="hostname" value="localhost" />
   ```
   the new location will be 
`WebKit/WebsiteData/LocalStorage/app_localhost_0.localstorage`
   
   To migrate this none of the plugins mentions here worked out of the box:
   https://github.com/kassamina/cordova-plugin-ionic-migrate-storage#thanks
   
   But I used 
[https://github.com/jairemix/cordova-plugin-migrate-localstorage](https://github.com/jairemix/cordova-plugin-migrate-localstorage)
 and updated the new location of localstorage based on my findings while 
inspection this. The tip is to uncomment the NSLog which logs file-location, 
and then in terminal on your mac open those in finder with the open command:
   
   `
   $ open /User/xx/...
   `
   
   You will then be able to find those files and adjust the files after your 
need. Mine was to change this line
   
   ```
   #define TARGET_LS_FILEPATH 
@"WebKit/WebsiteData/LocalStorage/http_localhost_8080.localstorage"
   ```
   
   to this:
   
   ```
   #define TARGET_LS_FILEPATH 
@"WebKit/WebsiteData/LocalStorage/app_localhost_0.localstorage"
   ```


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to