MiniAppExternalUrlLoader
public class MiniAppExternalUrlLoader
Undocumented
-
Undocumented
Declaration
Swift
public weak var currentWebViewController: UIViewController?
-
Undocumented
Declaration
Swift
public var currentResponseHandler: MiniAppNavigationResponseHandler?
-
Undocumented
Declaration
Swift
public var customMiniAppURL: URL?
-
This class supports the scenario that external loader redirects url that are only supported in mini app view, closes the external loader and emits that url to mini app view with the help of a MiniAppNavigationResponseHandler.
Declaration
Swift
public init(webViewController: UIViewController? = nil, responseHandler: MiniAppNavigationResponseHandler? = nil, customMiniAppURL: URL? = nil)
Parameters
webViewController
The UIViewController containing the external webview. Provide it if you want the controller to auto-close when a Mini App url is triggered.
responseHandler
a MiniAppNavigationResponseHandler closure that will provide the Mini App view the url that has been triggered.
customMiniAppURL
The url that was used to load the Mini App. Provide this if you want to manage the result of the external navigation inside your Mini App
-
Use this method inside your WKNavigationDelegate to provide the appropriate WKNavigationActionPolicy to the decidePolicyForNavigationAction method, and eventually close the external webview controller if a Mini App link is triggered and provide a feedback to the Mini App via the MiniAppNavigationResponseHandler
Declaration
Swift
public func shouldOverrideURLLoading(_ url: URL?) -> WKNavigationActionPolicy