iOSBrowser¶
Static API for launching the in-app browser from Unity.
Kodster.InAppWebBrowser.iOS.iOSBrowser
Overview¶
- On non-iOS platforms (including the Unity Editor),
Openis a no-op andonClosedis invoked immediately.
Methods¶
Open¶
public static void Open(
string url,
iOSBrowserOptions options = null,
Action onClosed = null,
Action<bool> onInitialLoadCompleted = null,
Action<string> onRedirected = null,
Action onOpenedInExternalBrowser = null
)
Opens the specified URL in the in-app browser.
Parameters
url(string): The URL to open.options(iOSBrowserOptions, optional): Visual and behavioral configuration. Whennull, defaults are used.onClosed(Action, optional): Invoked when the browser is closed.onInitialLoadCompleted(Action<bool>, optional): Invoked when the initial page load finishes. Theboolindicates success.onRedirected(Action<string>, optional): Invoked with the resolved URL if the initial load is redirected before completing.onOpenedInExternalBrowser(Action, optional): Invoked when the URL is handed off to an external app.
Throws
ArgumentException: Ifurlis null, empty, whitespace, or not a valid absolute http/https URL.
Remarks
- Opening a new browser while a previous one is still pending logs a warning; the previous callbacks will not be invoked.
Close¶
Closes the in-app browser.
PrefetchUrl¶
Pre-warms the browser connection for the given URL to improve perceived launch speed.
Parameters
url(string): The URL to pre-warm.
Throws
ArgumentException: Ifurlis null, empty, whitespace, or not a valid absolute http/https URL.
PrefetchUrls¶
Pre-warms the browser connections for the given URLs.
Parameters
urls(IEnumerable<string>): The URLs to pre-warm.
Throws
ArgumentNullException: Ifurlsis null.ArgumentException: If any URL in the sequence is null, empty, whitespace, or not a valid absolute http/https URL.