adjust-icon

다이렉트 딥링크 설정

앱이 설치된 사용자가 Adjust 링크를 클릭하면 다이렉트 딥링킹을 통해 앱 내의 특정 콘텐츠로 바로 이동할 수 있습니다.

작동 방식

  1. 사용자가 Adjust 링크를 클릭합니다.
  2. OS는 앱을 실행하고, 딥링크를 네이티브 코드(iOS 또는 Android)로 전달합니다.
  3. app_links 라이브러리는 링크를 Flutter 코드로 전달합니다.
  4. 코드는 어트리뷰션을 위해 링크를 Adjust SDK로 전달합니다. SDK는 단축 브랜드 링크도 해석합니다.
  5. 코드는 해석된 링크를 기반으로 사용자를 탐색합니다.

Adjust SDK 메서드

Adjust.processDeeplink 메서드를 사용하여 다음 작업을 수행합니다.

  • 딥링크 클릭에서 어트리뷰션 기록
  • 단축 브랜드 링크를 이에 상응하는 긴 브랜드 링크로 변환
  • 다른 모든 링크를 그대로 전달
메서드 서명
static Future<String?> processDeeplink(String deeplink)

앱이 URL 실행 (레거시)

Adjust.appWillOpenUrl 메서드는 딥링크 클릭으로부터의 어트리뷰션을 기록하지만, 단축 브랜드 링크는 확인하지 않습니다.

메서드 서명
static void appWillOpenUrl(String url)

processDeeplink 메서드는 이 레거시 메서드를 대체합니다.

구현

app_links 라이브러리를 사용하여 딥링크를 수신하고 Adjust SDK로 전달하시기 바랍니다.

pubspec.yaml
dependencies:
app_links: ^6.0.0 # check pub.dev for latest version
final _appLinks = AppLinks();
Future<void> _initDeepLinks() async {
// Handle link when app is started from a deep link
final initialLink = await _appLinks.getInitialLink();
if (initialLink != null) {
_handleDeepLink(initialLink);
}
// Handle links when app is already running
_appLinks.uriLinkStream.listen(_handleDeepLink);
}
Future<void> _handleDeepLink(Uri incomingLink) async {
// Send deep link to Adjust's servers for attribution.
// If short branded link, receive long link.
// Otherwise, receive original link.
final resolvedLink = await Adjust.processDeeplink(incomingLink.toString());
// Handle failure if resolvedLink is null
if (resolvedLink == null) return;
/*
* TODO: Handle the deep link by parsing the path
* and navigating to the appropriate screen.
*
* Possible resolvedLink formats:
*
* 1. https://brandname.go.link/?adj_t=abc123&
* adj_link=https%3A%2F%2Fexample.com%2Fsummer-clothes%3Fpromo%3Dbeach
* -> extract and decode the deep link from adj_link
*
* 2. https://brandname.go.link/summer-clothes?promo=beach&adj_t=abc123
* -> extract path from the URL
*
* 3. example://summer-clothes?promo=beach&adj_t=abc123
* -> extract path from the URL
*
* Note (Android only): If your Android app scheme path differs from iOS,
* you may receive:
* https://brandname.go.link/?adj_t=abc123&
* adj_deep_link=example%3A%2F%2Fandroid-specific-path%3Fparam%3Dvalue
* -> extract and decode the deep link from adj_deep_link
*/
}