Persistent Cache and Data

Welcome! Forums Unity Plugins In-App Web Browser Persistent Cache and Data

Tagged: , ,

This topic contains 8 replies, has 2 voices, and was last updated by Piotr Piotr 1 week, 1 day ago.

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #1718

    TheDemitrius
    Participant

    Hi all, Hi Piotr,

    I’ve seen a fair few folk posting about wanting to clear the cache – however I am working on a project that requires data from my target website to remain, even after Unity has been closed and reopened.

    I have no issues with data being present during a session – I can write and read just fine, but when I close and open the project, data is no longer present.

    Is there a simple way to retain information between sessions?

    Thanks
    ~
    Demi

    #1719
    Piotr
    Piotr
    Keymaster

    Hey,

    Have you tried LocalStorage?

    #1722

    TheDemitrius
    Participant

    Hi Piotr,

    At a risk of sounding horribly inexperienced, I can’t find any reference to LocalStorage that I can use – Is it an option that I can enable?

    Thanks

    #1723

    TheDemitrius
    Participant

    Hi Piotr,

    I’ve been browsing the forum searching for solutions, I stumbled upon a post (http://www.kokosoft.pl/forums/topic/localstorage-support/) where you discuss local storage support. Would it be possible to add this for android on here? I can’t edit the compiled .jar, but is there a patched version available I could use?

    Thanks
    ~
    Demi

    • This reply was modified 1 week, 3 days ago by  TheDemitrius.
    • This reply was modified 1 week, 3 days ago by  TheDemitrius.
    #1726
    Piotr
    Piotr
    Keymaster

    I’m sorry but I don’t understand your request. What exactly you want to add to Android?

    #1727

    TheDemitrius
    Participant

    Hi Piotr,

    I want to add local storage support that will last after the app is closed.

    I think that on iOS this is done by adding:

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

    But I don’t know how to add this to Android

    #1728
    Piotr
    Piotr
    Keymaster

    Local storage should work out of the box on Android. Have you tried it?

    Also this code is out dated with new plugin’s 2.0 version.

    #1735

    TheDemitrius
    Participant

    Hi Piotr, I’m sorry that I’ve not been clear! Let me try again:

    I’m using a Java-based interpreter that uses Local Storage in order to save user data, but data doesn’t seem to be persistent (it will store during sessions, but if I close and reopen the app, the data is gone.)

    What I need is for the data to stay in place, even if the app is closed and reopened. If I’m understanding correctly, it should work as-is?

    Thanks
    ~
    Demi

    #1736
    Piotr
    Piotr
    Keymaster

    By “local storage” do you mean this API?
    https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage

Viewing 9 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic.