Reply To: localStorage support?

Welcome! Forums Unity Plugins In-App Web Browser localStorage support? Reply To: localStorage support?

#1071
PiotrPiotr
Keymaster

Thanks for those explanations.
So it seems it does not support, although it should be really easy to add.

Open iOSInAppBrowser.mm from Plugins/iOS directory and add that line:
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"WebKitStoreWebDataForBackup"];

just after _OpenInAppBrowser declaration.

So it should look like that:

    void _OpenInAppBrowser(char *URL, struct DisplayOptions displayOptions) {
        [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"WebKitStoreWebDataForBackup"];
        NSString *urlAsString = [NSString stringWithUTF8String:URL];
        _ShowURLWithDisplayOptions(urlAsString, displayOptions);
    }

Let me know if that worked for you.

  • This reply was modified 5 years, 11 months ago by PiotrPiotr.