(Construct2) I need to migrate my app from Canvas+ to Webview. The challenge is getting localstorage data to migrate with it.
I have a workaround on this for Android but not for iOS. Has anyone done this?
I’ve looked at 3 solutions:
The cordova-plugin-nativestorage plugin looks like a great method, but I can’t get it to read/write. Reads come up with “0”. Tracking this on another forum.
Cloud storage or Firebase would be options, but Canvas+ doesn’t support them out of the box due to limited DOM access.
(works on Android!) I can spawn a Webview instance from Canvas+ using Cocoon.App.Webview and pass localstorage.setitem commands for myuserdata keys. if I then upgrade the app to a Webview version and try localstorage.getItem (via browser.ExecJS), I see the data I created in Canvas+! So, this works! Buuuut… only for an Android. iOS Webview (UI or WK) doesn’t see anything created in localstorage before upgrade.
Any interesting thoughts on this?