Open oleksiivinogradov opened 4 months ago
This plugin doesn't forbid intents by default as it mainly targets trusted origins. You may utilize SetURLPattern() (cf. #550) to hook intents and show a warning dialog in unity.
Also, it might be better to utilize SFSafariViewController/Chrome Custom Tabs instead for your purpose. They are restricted but more compatible with Safari/Chrome. https://github.com/gree/unity-webview/tree/ac07c49acc27e72b2939c4be70bd5d05b1308855/appendix/sample-sfsafariviewcontroller-chromecustomtabs provides a simple example.
I cannot help about how the metamask app works for the url. As noted before, it might be better to use SFSafariViewController/Chrome Custom Tabs. Moreover, it might be better to utilize MetaMask SDK: https://docs.metamask.io/wallet/how-to/use-sdk/mobile/ .
page https://myhome2.cfc.io/wc/
code:
WebViewObject webViewObject; IEnumerator StartWebView() { webViewObject = (new GameObject("WebViewObject")).AddComponent();
webViewObject.Init(
cb: (msg) =>
{
Debug.Log(string.Format("CallFromJS[{0}]", msg));
},
err: (msg) =>
{
Debug.Log(string.Format("CallOnError[{0}]", msg));
},
httpErr: (msg) =>
{
Debug.Log(string.Format("CallOnHttpError[{0}]", msg));
},
started: (msg) =>
{
Debug.Log(string.Format("CallOnStarted[{0}]", msg));
},
hooked: (msg) =>
{
Debug.Log(string.Format("CallOnHooked[{0}]", msg));
},
cookies: (msg) =>
{
Debug.Log(string.Format("CallOnCookies[{0}]", msg));
},
ld: (msg) =>
{
Debug.Log(string.Format("CallOnLoaded[{0}]", msg));
if UNITY_EDITOR_OSX || UNITY_STANDALONE_OSX || UNITY_IOS
if true
else
endif
elif UNITY_WEBPLAYER || UNITY_WEBGL
else
endif
if UNITY_EDITOR_OSX || UNITY_STANDALONE_OSX
endif