-
Notifications
You must be signed in to change notification settings - Fork 703
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
Unity webview deal with 404 error #1054
Comments
You can detect it by the |
Koji bro, You are Awesome. Thank you for the direction, I will check it out |
Yes, in that callback, you can do as the following: diff --git a/sample/Assets/Scripts/SampleWebView.cs b/sample/Assets/Scripts/SampleWebView.cs
index 14e3428..03ef4e6 100644
--- a/sample/Assets/Scripts/SampleWebView.cs
+++ b/sample/Assets/Scripts/SampleWebView.cs
@@ -52,6 +52,10 @@ public class SampleWebView : MonoBehaviour
Debug.Log(string.Format("CallOnHttpError[{0}]", msg));
status.text = msg;
status.GetComponent<Animation>().Play();
+ if (msg == "404")
+ {
+ Destroy(webViewObject.gameObject);
+ }
},
started: (msg) =>
{ |
For some reason this line of codes are not working on phone. |
I pushed a modified sample app that can be directly opened and built with 2022.3.14f1 (because a Xcode project exported with 2022.3.8f1 cannot be built with Xcode 15.3) under: https://github.com/gree/unity-webview/tree/example-for-1054/sample where 404 test code is found in 767d1c5 . This sample app works okay on OSCAL Pad 8 (Android 11) and iPhone SE 3rd (iOS 17.4). |
I am developing only Android App. I am downloading this sample app which you pushed. And try if thats work. |
Hello Koji Bro. That sample Project you uploaded worked. |
Hello I just installed Webview on my Unity game by "KojiNakamaru" which is working great but I am having problem while dealing with 404 error.
I want my App to open Web if the web page is valid, If its missing or 404 error then open the simple app itself.
Any idea how to achieve that?
The text was updated successfully, but these errors were encountered: