Handling deeplinks
What the SDK delivers
Registering a listener
import AmplySDK
class AppDeepLinkHandler: DeepLinkListener {
func onDeepLink(url: String, info: [String: Any]) -> Bool {
print("Amply deeplink: \(url) info: \(info)")
if url.hasPrefix("yourapp://promo/") {
// Navigate to promo screen
Router.shared.showPromo(url: url)
return true
}
// Let another handler deal with it
return false
}
}
// Somewhere during app startup, after SDK init:
let handler = AppDeepLinkHandler()
amply.registerDeepLinkListener(listener: handler)Return value (iOS + Android)
Multiple listeners
When the app should wait for the outcome
React Native: unsubscribing
URL schemes
Testing
Related
Last updated