4
votes

Is there a way to transfer a user's LocalStorage data to the wkwebview browser when adding the cordova-plugin-wkwebview-engine plugin into an existing cordova/ionic project?

WKWebView is essentially a different browser and has no knowledge of any previous data saved within the UIWebView browser.

Crosswalk for Android handles this process automatically by migrating data to the new browser when the plugin is installed and first run on an existing user's device.

1
As you are defining your persistence?sioesi
@sioesi I have clarified the question.Charles
@Charles Found any solutions?Benjamin E.
@BenjaminE. We abandoned the idea of using wkwebview and stuck with the stock browser on iOS.Charles

1 Answers

2
votes

This Cordova plugin seems to be doing exactly what you describe, it migrates the localStorage from UIWebView over to be used in WKWebview: https://github.com/MaKleSoft/cordova-plugin-migrate-localstorage

Someone even forked it to add more functionality, such as migrating IndexedDB: https://github.com/jairemix/cordova-plugin-migrate-localstorage

Hope this helps!