MiniAppNavigationDelegate
public protocol MiniAppNavigationDelegate : AnyObject
A delegate used by Mini App view to communicate about available actions based on current user interactions on the Mini App
-
miniAppNavigation(shouldOpen:
Default implementationwith: onClose: ) This delegate method is called when an external URL is tapped into a Mini App so you can display your own webview to load the url parameter, for example. A
MiniAppNavigationResponseHandler
is also provided so you can give a proper feedback to your MiniApp under the form of an URL when you wantDefault Implementation
Declaration
Swift
func miniAppNavigation(shouldOpen url: URL, with responseHandler: @escaping MiniAppNavigationResponseHandler, onClose closeHandler: MiniAppNavigationResponseHandler?)
Parameters
url
the external URL triggered from the MiniApp
responseHandler
a
MiniAppNavigationResponseHandler
used to provide an URL to the Mini App -
miniAppNavigation(shouldOpen:
Default implementationwith: onClose: customMiniAppURL: ) This delegate method is called when an external URL is tapped into a url loaded Mini App so you can display your own webview to load the url parameter, for example. A
MiniAppNavigationResponseHandler
is also provided so you can give a proper feedback to your MiniApp under the form of an URL when you want. This should only be used for previewing a mini app from a local server.Default Implementation
Declaration
Swift
func miniAppNavigation(shouldOpen url: URL, with responseHandler: @escaping MiniAppNavigationResponseHandler, onClose closeHandler: MiniAppNavigationResponseHandler?, customMiniAppURL: URL)
Parameters
url
the external URL triggered from the MiniApp
responseHandler
a
MiniAppNavigationResponseHandler
used to provide an URL to the Mini AppcustomMiniAppURL
The url that was used to load the Mini App.
-
miniAppNavigation(canUse:
Default implementation) This delegate method is called when a navigation is performed inside the Mini App.
Default Implementation
Declaration
Swift
func miniAppNavigation(canUse actions: [MiniAppNavigationAction])
Parameters
actions
a list of
MiniAppNavigationAction
that can be used to navigate inside the Mini App -
miniAppNavigation(delegate:
Default implementation) This delegate method is called when a Mini App view is created.
Default Implementation
Declaration
Swift
func miniAppNavigation(delegate: MiniAppNavigationBarDelegate)
Parameters
delegate
a
MiniAppNavigationBarDelegate
the can be used to callMiniAppNavigationAction
on the Mini App view -
miniAppNavigationCanGo(back:
Default implementationforward: ) This delegate is called whenever any page is routed and it tells whether the webview canGoBack or canGoForward
Default Implementation
Declaration
Swift
func miniAppNavigationCanGo(back: Bool, forward: Bool)
Parameters
back
True if WebView can go back
forward
True if WebView can go forward
-
checkWebsiteSecurity(url:
Extension methodwith: ) Undocumented
Declaration
Swift
func checkWebsiteSecurity(url: URL, with responseHandler: @escaping (Bool) -> Void)