EcoCoordinator provides built-in methods for checking and handling Birbonus deep links.
public extension EcoCoordinator {
/// Returns true when the URL can be handled by Birbonus.
func canHandle(_ url: URL) -> Bool
/// Handles a supported Birbonus deep link.
/// The optional completion handler receives the navigation result.
func handle(
_ url: URL,
completion: ((Bool) -> Void)? = nil
)
}func application(
_ app: UIApplication,
open url: URL,
options: [UIApplication.OpenURLOptionsKey: Any] = [:]
) -> Bool {
guard coordinator.canHandle(url) else {
// The URL is not a Birbonus deep link.
// Handle it in the host application.
return false
}
coordinator.handle(url) { success in
if success {
print("Deep link handled successfully")
} else {
print("Failed to handle deep link")
}
}
return true
}canHandle(_:) before passing a URL to handle(_:).true result means the SDK recognizes the URL.false result means the host application must handle the URL itself.true when navigation succeeds.