Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

webpage update in server but not updated client side app #1049

Open
SachinTichkule opened this issue Feb 15, 2024 · 3 comments
Open

webpage update in server but not updated client side app #1049

SachinTichkule opened this issue Feb 15, 2024 · 3 comments

Comments

@SachinTichkule
Copy link

need to update the webview then i have to clear my app data then changes are seen in our webview in unity app.
what should i do to prevent this issue.

@KojiNakamaru
Copy link
Member

The plugin has webViewObject.ClearCache(true) for Android/iOS. For any platform, adding a url parameter is a most reliable way:

        webViewObject.LoadURL(Url.Replace(" ", "%20") + "?_=" + (System.DateTime.UtcNow.Subtract(new System.DateTime(1970, 1, 1))).TotalSeconds);

You can also utilize the following to forcibly reload the current page.

        webViewObject.EvaluateJS("window.location.href = window.location.href.replace(/#.*$/, '')")

@SachinTichkule
Copy link
Author

webViewObject.ClearCache(true);
it take little long time to load url in webview means its shows black screen for long time.

@KojiNakamaru
Copy link
Member

Yes, so it is better to utilize other methods. If you control the html server, you can also disable cache by apache .htaccess, for example (cf. https://stackoverflow.com/questions/22891965/how-to-disable-cache-of-apache/22892020#22892020 ). Such settings should be okay at least for debugging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants