Adjust 대시보드에서 딥링크가 설정되면 앱에서 딥링크를 구성할 수 있습니다. 다이렉트 딥링크 는 사용자가 이미 기기에 앱을 설치한 경우에 작동하며, 사용자를 앱 내 특정 페이지로 이동시킵니다.
딥링크를 활성화하려면 다음을 수행해야 합니다.
- Adjust의 AppView에서 iOS와 Android 앱에 대해 동일한 브랜드 도메인 을 설정합니다.
- 앱의 Associated Domains 활성화
- Xcode에서 딥링크 구성
Associated Domains 활성화
Apple 개발자 계정에서 Associated Domains를 활성화해야, 앱에서 유니버설 링크 도메인을 설정할 수 있습니다. 이를 위해 다음의 단계를 수행하시기 바랍니다.
- Apple 개발자 계정에 로그인합니다.
- 왼쪽 메뉴에서 Certificates, IDs & Profiles 를 선택합니다.
- 왼쪽 메뉴에서 Identifiers 를 선택합니다.
- 앱을 찾은 뒤 선택하여 편집 페이지를 실행합니다.
- Associated Domains 가 Capabilities 아래에 체크 표시되어있는지 확인합니다.
- Save 를 선택하여 변경 내용을 저장합니다.
Xcode에서 딥링크 구성
다음의 단계를 수행하여 Xcode 프로젝트에 딥링크 구성을 추가하시기 바랍니다.
Adjust 유니버설 링크와 브랜드 도메인
-
Xcode에서 앱 프로젝트를 실행합니다.
-
왼쪽 메뉴에서 프로젝트를 선택합니다.
-
Targets 에서 앱을 선택합니다.
-
상단 메뉴에서 Signing & Capabilities 를 선택합니다.
-
아래 하위 메뉴에 All 이 선택되어 있는지 확인합니다.
-
Add 옵션( + )을 선택하여 기능을 추가합니다.
-
Associated Domains 를 선택합니다.
-
접두어와 함께 Adjust 유니버설 링크 도메인을 입력합니다.
applinks:
- 다음은
example.adj.st
도메인을 사용한 예시입니다.applinks:example.adj.st
- 다음은
-
Adjust에서 앱의 브랜드 도메인을 설정 시 설정한 브랜드 링크 도메인을 입력합니다.
- 다음은
brandedDomain.go.link
도메인을 사용한 예시입니다.brandedDomain.go.link
- 다음은
유니버설 링크 도메인으로 이미 xxx.adj.st
를 사용하고 있다면 삭제하지 마시기 바랍니다. xxx.adj.st
와 brandedDomain.go.link
를 모두 연결된 도메인으로 유지합니다.
맞춤 URL 스킴
- Xcode에서 앱 프로젝트를 실행합니다.
- 왼쪽 메뉴에서 프로젝트를 선택합니다.
- Targets 에서 앱을 선택합니다.
- 상단 메뉴에서 Info 를 선택합니다.
- URL Types 섹션을 펼쳐보기 합니다.
- Add 옵션( + )을 선택하여 URL 유형을 추가합니다.
- 다음의 정보를 입력하여 URL 스킴을 생성합니다.
- 식별자 :
$(PRODUCT_BUNDLE_IDENTIFIER)
- URL 스킴 : 맞춤 URL 스킴. 반드시 고유해야 합니다. 다음과 같은 보안 스킴을 사용하지 마시기 바랍니다.
http
,https
또는mailto
- 역할 : 편집자
- 식별자 :
이 스킴은 프로덕션과 디버그 빌드 모두 에 작동합니다.
iOS 앱 변경
다양한 딥링크 시나리오를 설정하려면 iOS 앱을 업데이트해야 합니다. 앱을 업데이트 하는 방식은 앱이 scene을 사용하는지 여부에 따라 달라집니다.
앱이 scene을 사용하지 않는 경우
앱이 scene을 사용하지 않는 경우, 앱 델리게이트에서 메서드를 업데이트해야 합니다.
유니버설 링크
Adjust SDK에서 다음의 메서드를 호출하기 위해 앱 델리게이트에서 application(_:continue:restorationHandler:)
메서드를 업데이트합니다.
ADJLinkResolution.resolveLink
: 마케팅팀에서 Adjust의 링크 해석(link resolution) 솔루션을 필요로 하는 경우에만 이 메서드를 호출합니다. 딥링크가resolveUrlSuffixArray
의 요소와 일치하는 도메인을 사용하는 경우, 이 메서드는 딥링크를 해석하려고 시도하여 해석된 링크를 반환합니다. 딥링크가 이 배열의 요소와 일치하지 않는 경우, 이 메서드는 원래의 딥링크를 전달하므로 모든 딥링크를 이 메서드로 전달할 수 있습니다.Adjust.processDeeplink
- 이 메서드를 호출하여 정보 기록을 위해 딥링크를 Adjust 서버로 전송합니다. Adjust 딥링크와 비 Adjust 딥링크 모두 이 메서드를 통해 전달할 수 있습니다. Adjust 서버는 Adjust 파라미터가 없는 딥링크를 모두 무시합니다.
사용자가 유니버설 링크를 클릭하면 iOS가 앱을 실행하고 딥링크를 application(_:continue:restorationHandler:)
으로 전달합니다. 이는 사용자가 앱을 종료한 상태거나 앱이 백그라운드에서 실행 중인지와 관계없이 작동합니다.
func application( _ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool {
if userActivity.activityType == NSUserActivityTypeBrowsingWeb { if let incomingURL = userActivity.webpageURL { // call the below method to resolve deep link ADJLinkResolution.resolveLink( with: incomingURL, resolveUrlSuffixArray: ["email.example.com", "short.example.com"], callback: { resolvedURL in // add your code below to handle deep link // (for example, open deep link content) // resolvedURL object contains the deep link if let resolvedDeeplink = resolvedURL { // call the below method to send deep link to Adjust's servers if let deeplink = ADJDeeplink(deeplink: resolvedDeeplink) { Adjust.processDeeplink(deeplink) } } }) } } else { return false }
return true}
- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler: (void (^)(NSArray *restorableObjects))restorationHandler {
if ([[userActivity activityType] isEqualToString:NSUserActivityTypeBrowsingWeb]) { NSURL *incomingURL = [userActivity webpageURL];
// call the below method to resolve deep link [ADJLinkResolution resolveLinkWithUrl:incomingURL resolveUrlSuffixArray:@[ @"email.example.com", @"short.example.com" ] callback:^(NSURL* _Nullable resolvedURL) { // add your code below to handle deep link // (for example, open deep link content) // resolvedURL object contains the deep link
// call the below method to send deep link to Adjust's servers ADJDeeplink *deeplink = [[ADJDeeplink alloc] initWithDeeplink:resolvedURL]; [Adjust processDeeplink:deeplink]; }]; } else { return NO; }
return YES;}
맞춤 URL 스킴
마케팅팀이 맞춤 URL 스킴 딥링크 설정을 원하는 경우, 앱 델리게이트에서 application(_:open:options:)
메서드를 업데이트하고 Adjust SDK에서 Adjust.processDeeplink
메서드를 호출합니다. 이 메서드는 딥링크를 Adjust 서버로 전송하여 이를 기록합니다. Adjust 딥링크와 비 Adjust 딥링크 모두 이 메서드를 통해 전달할 수 있습니다. Adjust 서버는 Adjust 파라미터가 없는 딥링크를 모두 무시합니다.
사용자가 맞춤 URL 스킴 딥링크를 클릭하면 iOS가 앱을 실행하고 딥링크를 application(_:open:options:)
으로 전달합니다. 이는 사용자가 앱을 종료한 상태거나 앱이 백그라운드에서 실행 중인지와 관계없이 작동합니다.
func application( _ app: UIApplication, open incomingURL: URL, options: [UIApplication.OpenURLOptionsKey: Any] = [:] ) -> Bool {
// add your code below to handle deep link // (for example, open deep link content) // incomingURL object contains the deep link
// call the below method to send deep link to Adjust's servers if let deeplink = ADJDeeplink(deeplink: incomingURL) { Adjust.processDeeplink(deeplink) } return true}
- (BOOL)application:(UIApplication *)app openURL:(NSURL *)incomingURL options:(NSDictionary *)options {
// add your code below to handle deep link // (for example, open deep link content) // incomingURL object contains the deep link
// call the below method to send deep link to Adjust's servers [Adjust processDeeplink:[[ADJDeeplink alloc] initWithDeeplink:incomingURL]];
return YES;}
앱이 scene을 사용하는 경우
앱이 scene을 사용하는 경우, scene 델리게이트에서 메서드를 업데이트해야 합니다.
유니버설 링크
- scene 델리게이트에서
scene(_:willConnectTo:options:)
메서드를 업데이트합니다. 사용자가 유니버설 링크를 클릭하고 앱은 종료된 상태인 경우, iOS는 앱을 실행하고 딥링크를 이 메서드에 전달합니다. - scene 델리게이트에서
scene(_:continue:)
메서드를 업데이트합니다. 사용자가 유니버설 링크를 클릭하고 앱이 백그라운드에서 실행 중인 경우, iOS는 앱을 실행하고 딥링크를 이 메서드에 전달합니다.
위 메서드는 Adjust SDK에서 다음의 메서드를 호출합니다.
ADJLinkResolution.resolveLink
: 마케팅팀에서 Adjust의 링크 해석(link resolution) 솔루션을 필요로 하는 경우에만 이 메서드를 호출합니다. 딥링크가resolveUrlSuffixArray
의 요소와 일치하는 도메인을 사용하는 경우, 이 메서드는 딥링크를 해석하려고 시도하여 해석된 링크를 반환합니다. 딥링크가 이 배열의 요소와 일치하지 않는 경우, 이 메서드는 원래의 딥링크를 전달하므로 모든 딥링크를 이 메서드로 전달할 수 있습니다.Adjust.processDeeplink
- 이 메서드를 호출하여 기록을 위해 딥링크를 Adjust 서버로 전송합니다. Adjust 딥링크와 비 Adjust 딥링크 모두 이 메서드를 통해 전달할 수 있습니다. Adjust 서버는 Adjust 파라미터가 없는 딥링크를 모두 무시합니다.
func scene( _ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions ) {
guard let userActivity = connectionOptions.userActivities.first, userActivity.activityType == NSUserActivityTypeBrowsingWeb, let incomingURL = userActivity.webpageURL else { return }
// call the below method to resolve deep link ADJLinkResolution.resolveLink( withUrl: incomingURL, resolveUrlSuffixArray: ["email.example.com", "short.example.com"], callback: { resolvedURL in // add your code below to handle deep link // (for example, open deep link content) // resolvedURL object contains the deep link
// call the below method to send deep link to Adjust's servers if let deeplink = ADJDeeplink(deeplink: resolvedURL) { Adjust.processDeeplink(deeplink) } })}
func scene( _ scene: UIScene, continue userActivity: NSUserActivity) {
if userActivity.activityType == NSUserActivityTypeBrowsingWeb { let incomingURL = userActivity.webpageURL
// call the below method to resolve deep link ADJLinkResolution.resolveLink( withUrl: incomingURL, resolveUrlSuffixArray: ["email.example.com", "short.example.com"], callback: { resolvedURL in // add your code below to handle deep link // (for example, open deep link content) // resolvedURL object contains the deep link
// call the below method to send deep link to Adjust's servers if let deeplink = ADJDeeplink(deeplink: resolvedURL) { Adjust.processDeeplink(deeplink) } }) }}
- (void)scene:(UIScene *)scene willConnectToSession:(UISceneSession *)session options:(UISceneConnectionOptions *)connectionOptions {
NSUserActivity* userActivity = [[[connectionOptions userActivities] allObjects] firstObject];
if ([[userActivity activityType] isEqualToString:NSUserActivityTypeBrowsingWeb]) { NSURL *incomingURL = [userActivity webpageURL];
// call the below method to resolve deep link [ADJLinkResolution resolveLinkWithUrl:incomingURL resolveUrlSuffixArray:@[ @"email.example.com", @"short.example.com" ] callback:^(NSURL* _Nullable resolvedURL) { // add your code below to handle deep link // (for example, open deep link content) // resolvedURL object contains the deep link
// call the below method to send deep link to Adjust's servers ADJDeeplink *deeplink = [[ADJDeeplink alloc] initWithDeeplink:resolvedURL]; [Adjust processDeeplink:deeplink]; }]; }}
- (void)scene:(UIScene *)scene continueUserActivity:(NSUserActivity *)userActivity{ if ([[userActivity activityType] isEqualToString:NSUserActivityTypeBrowsingWeb]) { NSURL *incomingURL = [userActivity webpageURL];
// call the below method to resolve deep link [ADJLinkResolution resolveLinkWithUrl:incomingURL resolveUrlSuffixArray:@[ @"email.example.com", @"short.example.com" ] callback:^(NSURL* _Nullable resolvedURL) { // add your code below to handle deep link // (for example, open deep link content) // resolvedURL object contains the deep link
// call the below method to send deep link to Adjust's servers ADJDeeplink *deeplink = [[ADJDeeplink alloc] initWithDeeplink:resolvedURL]; [Adjust processDeeplink:deeplink]; }]; }}
맞춤 URL 스킴
- scene 델리게이트에서
scene(_:willConnectTo:options:)
메서드를 업데이트합니다. 사용자가 맞춤 URL 스킴 딥링크를 클릭하고 앱은 종료된 상태인 경우, iOS는 앱을 실행하고 딥링크를 이 메서드에 전달합니다. - scene 델리게이트에서
scene(_:openURLContexts:)
메서드를 업데이트합니다. 사용자가 맞춤 URL 스킴 딥링크를 클릭하고 앱이 백그라운드에서 실행 중인 경우, iOS는 앱을 실행하고 딥링크를 이 메서드에 전달합니다.
위 메서드는 Adjust SDK에서 Adjust.processDeeplink
메서드를 호출합니다. 이 메서드는 딥링크를 Adjust 서버로 전송하여 이를 기록합니다. Adjust 딥링크와 비 Adjust 딥링크 모두 이 메서드를 통해 전달할 수 있습니다. Adjust 서버는 Adjust 파라미터가 없는 딥링크를 모두 무시합니다.
func scene( _ scene: UIScene, openURLContexts URLContexts: Set<uiopenurlcontext> ) {
guard let incomingURL = URLContexts.first?.url else { return }
// add your code below to handle deep link // (for example, open deep link content) // incomingURL object contains the deep link
// call the below method to send deep link to Adjust's servers if let deeplink = ADJDeeplink(deeplink: incomingURL) { Adjust.processDeeplink(deeplink) }}
- (void)scene:(UIScene *)scene openURLContexts:(nonnull NSSet<uiopenurlcontext *> *)URLContexts {
NSURL *incomingURL = [[URLContexts allObjects] firstObject].URL;
if (incomingURL) { // add your code below to handle deep link // (for example, open deep link content) // incomingURL object contains the deep link
// call the below method to send deep link to Adjust's servers ADJDeeplink *deeplink = [[ADJDeeplink alloc] initWithDeeplink:incomingURL]; [Adjust processDeeplink:deeplink]; }}