PROTOCOL
HaapiFlowDeepLinkable
public protocol HaapiFlowDeepLinkable: AnyObject
An interface declaration for Haapi operations that can handle deep links.
When receiving a deep link, invoke first canHandleUrl
to assess the URL
. If it returns true
, invoke handleUrl
.
- Note:
- If using an AppDelegate and a SceneDelegate,
func scene(_ scene: UIScene, openURLContexts URLContexts: Set<UIOpenURLContext>)
has to be implemented and use the following methods. - If using an AppDelegate and not a SceneDelegate,
func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool
has to be implemented and use the following methods. - If using SwiftUI,
.onOpenURL(perform: ...)
has to be implemented in@main
of the content view and use the following methods.
- If using an AppDelegate and a SceneDelegate,
Methods
canHandleUrl(_:)
func canHandleUrl(_ url: URL) -> Bool
Returns a Bool whether the url
can be handled.
handleUrl(_:)
func handleUrl(_ url: URL)
Handles the url. If the url cannot be handled, a fatalError
is invoked.
- Note: To avoid a
fatalError
,canHandleUrl
has to be invoked first and it needs to returntrue
.