An interface implemented by a webview if it supports deep linking (i.e. launching an external application by executing a URL with a custom protocol). Deep linking is disabled by default but can be enabled with SetDeepLinkingEnabled()
await webViewPrefab.WaitUntilInitialized();
var webViewWithDeepLinking = webViewPrefab.WebView as IWithDeepLinking;
if (webViewWithDeepLinking == null) {
Debug.Log("This 3D WebView plugin doesn't support IWithDeepLinking: " + webViewPrefab.WebView.PluginType);
return;
}
webViewWithDeepLinking.SetDeepLinkingEnabled(true);
// Load a page with a link that opens the YouTube app.
webViewPrefab.WebView.LoadHtml("<a href='vnd.youtube://grP0iDrSjso'>Click to launch YouTube</a>");
On iOS, in order to open a link with a custom URI scheme, that scheme must also be listed i the app's Info.plist using the key LSApplicationQueriesSchemes otherwise iOS will block the custom URI scheme from being loaded Example Info.plist entry:
<key>LSApplicationQueriesSchemes</key>
<array>
<string>vnd.youtube</string>
</array>
On Android, deep linking is only triggered by a URL with a custom scheme (e.g. my-app://path). A URL with an http:// or https:// scheme will always open the web page in the browser rather than deep link to an external app.
void SetDeepLinkingEnabled(bool enabled)
Sets whether deep links are enabled. The default is false
.