以下是针对特定用例实施附加深度链接功能。
直接深度链接
获取最近的深度链接
+ (void)lastDeeplinkWithCompletionHandler:(nonnull ADJLastDeeplinkGetterBlock)completion;
您可以通过调用 Adjust.lastDeeplinkWithCompletionHandler:
方法,返回发送至 Adjust.processAndResolveDeeplink
或 Adjust.processDeeplink
方析的最近一个深度链接 URL。此方法会以 NSURL 的形式返回最近的深度链接。
Adjust.lastDeeplink { lastDeeplink in
if let deeplink = lastDeeplink {
// Handle the deeplink here
print("Last deep link: \(deeplink.absoluteString)")
[Adjust lastDeeplinkWithCompletionHandler:^(NSURL * _Nullable lastDeeplink) {
if (lastDeeplink != nil) {
// Handle the deeplink here
NSLog(@"Last deep link: %@", [lastDeeplink absoluteString]);
处理带有 referrer 的深度链接
可选 referrer URL,用于跟踪深度链接或应用打开的来源,以优化归因或再归因和深度链接。例如,对于 SEO / 自然搜索等渠道,Adjust 链接不会直接被使用。如果客户的根域已部署通用链接,并触发了应用打开,那么对于此类渠道来说,我们可能必须通过 referrer URL 传入的信号开展用户归因或再归因。
设置 referrer URL
func application(_ application: UIApplication,
continue userActivity: NSUserActivity,
restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool {
if userActivity.activityType.isEqual(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.
if let incomingURL = userActivity.webpageURL {
if let deeplink = ADJDeeplink(deeplink: incomingURL) {
// If referrer URL is available, add it to the deeplink object
if let referrer = URL(string: "https://example.com") {
deeplink.setReferrer(referrer)
Adjust.processAndResolve(deeplink) { resolveDeeplink in
// resolvedLink contains either resolved URL (if it was unshortened)
// or just echoed URL if it was not shortened
- (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.
ADJDeeplink *deeplink = [[ADJDeeplink alloc] initWithDeeplink:[userActivity webpageURL]];
NSURL *referrer = [NSURL URLWithString:@"https://example.com"];
// If referrer URL is available, add it to the deeplink object
[deeplink setReferrer:referrer];
[Adjust processAndResolveDeeplink:deeplink
withCompletionHandler:^(NSString * _Nullable resolvedLink) {
// resolvedLink contains either resolved URL (if it was unshortened)
// or just echoed URL if it was not shortened
延迟深度链接
设置 Adjust LinkMe
Adjust LinkMe 解决方案为可选功能,能通过允许应用从设备剪贴板读取深度链接信息来确保延迟深度链接表现。
当用户点击 LinkMe URL 时,可以选择将链接信息复制到剪贴板。您可以使用 Adjust SDK 读取系统剪贴板,获取深度链接信息。如果含有深度链接信息,Adjust SDK 就会将用户转到应用中的正确页面。
要在应用中启用剪贴板查看功能,请调用[ADJConfig enableLinkMe]
方法。
let yourAppToken = "{YourAppToken}"
let environment = ADJEnvironmentSandbox
let adjustConfig = ADJConfig(
environment: environment)
adjustConfig.enableLinkMe()
NSString *yourAppToken = @"{YourAppToken}";
NSString *environment = ADJEnvironmentSandbox;
ADJConfig *adjustConfig = [[ADJConfig alloc] initWithAppToken:@"{YourAppToken}"
environment:ADJEnvironmentSandbox];
[adjustConfig enableLinkMe];