Adjustのリンク短縮ソリューションは、複雑で長いリンクをより簡潔で短いリンクに変換します。短縮リンクはディープリンクとキャンペーン情報を保持し、アプリがインストールされていない場合は、ユーザーをApp Storeに誘導します。
このセクションで説明するメソッドを使用して、短縮リンクを解析します。
Adjust SDKでディープリンクを設定
Adjust SDKに、以下のサポートを追加してください。
Adjust SDKを設定して短縮リンクを解析
+ (void)processDeeplink:(nonnull NSURL *)deeplink completionHandler:(void (^_Nonnull)(NSString * _Nonnull resolvedLink))completionHandler;
AppDelegate
からprocessDeeplink:completionHandler:
メソッドを呼び出して、ユーザーをアプリにディープリンクした短いAdjustリンクURLを解析します。
- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray<id<uiuseractivityrestoring>> *restorableObjects))restorationHandler { if ([[userActivity activityType] isEqualToString:NSUserActivityTypeBrowsingWeb]) { // Pass deep link URL to Adjust in order to potentially reattribute the user // and to get the URL resolved if it’s a shortened one. [Adjust processDeeplink:[userActivity webpageURL] completionHandler:^(NSString * _Nonnull resolvedLink) { // resolvedLink contains either resolved URL (if it was unshortened) // or just echoed URL if it was not shortened }]; } return YES;}
processDeeplink:completionHandler:
メソッドに送信したリンクが短縮されていた場合、 resolvedLink
は拡張された元のリンクを返します。メソッドにパスしたリンクが短縮されていない場合、 resolvedLink
にはパスした同じリンクが含まれます。