Для ручной отправки события об открытии и переходе по deeplink необходимо вызвать следующий код:
TrackerTop100.trackDeeplink(link: deeplink)
[TrackerTop100 trackDeeplinkWithLink: deeplink]
DEEPLINK (обязательный) - строковое представление deeplink, например, "myapp://path/to/screen"
func application(
_ app: UIApplication,
open url: URL,
options: [UIApplication.OpenURLOptionsKey: Any] = [:]
) -> Bool {
TrackerTop100.trackDeeplink(link: url.absoluteString)
return true
}
func application(
_ application: UIApplication,
continue userActivity: NSUserActivity,
restorationHandler: @escaping (\[UIUserActivityRestoring\]?) -> Void
) -> Bool {
if userActivity.activityType == NSUserActivityTypeBrowsingWeb,
let webpageURL = userActivity.webpageURL
{
TrackerTop100.trackDeeplink(link: webpageURL.absoluteString)
}
return true
}
@implementation AppDelegate
- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url
options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options
{
[TrackerTop100 trackDeeplinkWithLink: url.absoluteString\];
return YES;
}
- (BOOL)application:(UIApplication *)application
continueUserActivity:(NSUserActivity *)userActivity
restorationHandler:(void (^)(NSArray<id<UIUserActivityRestoring>> * _Nullable))restorationHandler
{
if ([userActivity.activityType isEqualToString:NSUserActivityTypeBrowsingWeb]) {
[TrackerTop100 trackDeeplinkWithLink: userActivity.webpageURL.absoluteString];
}
return YES;
}
@end
Last updated