You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

iOS 18环境下Bitly SDK实现移动深度链接无响应的问题求助

iOS 18环境下Bitly SDK实现移动深度链接无响应的问题求助

各位开发者大佬好,我现在在做iOS 18的POC项目(还没正式发布,目前只在TestFlight上测试),集成Bitly SDK实现深度链接时遇到了棘手的问题,想请大家帮忙排查下。

我按照Bitly的文档(说句实在话,这文档看起来有点过时,关于移动端深度链接的信息也挺匮乏)完成了这些配置:

  • 在Bitly控制台创建了移动端应用,同时配置了自定义域名
  • 将同一个自定义域名添加到了项目的Associated Domains配置项中
  • 使用自定义域名生成了短链接,目标链接设置为https://test.com/?page=testing

预期行为:点击短链接可以正常打开App,我们能从深度链接中获取到目标链接,进而引导用户跳转到对应的页面
实际行为:App确实能被正常唤起,但完全接收不到BitlyResponse——既拿不到目标链接,也没有任何相关的链接信息,根本没法执行后续的跳转逻辑

我是不是遗漏了某个配置步骤,或者哪里的操作出现了问题?下面是我的AppDelegate.swift代码:

import Foundation
import BitlySDK

class AppDelegate: NSObject, UIApplicationDelegate {
    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
        Bitly.initialize("BITLY_APP_ID", supportedDomains:["CUSTOM_DOMAIN"], supportedSchemes: [""]) { response, error in
            // response provides a BitlyResponse object which contains the full URL information
            // response includes a status code
            // error provides any errors in retrieving information about the URL
            // Your custom logic goes here...
            if let deepLink = response?.url {
                print("✅ Received deep link: \(deepLink)")
                if let url = URL(string: deepLink) {
                    DeepLinkManager.shared.handle(url: url)
                }
            } else {
                DispatchQueue.main.async {
                    DeepLinkManager.shared.page = "Response not called"
                }
            }
        }
        return true
    }
    
    func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool {
        return Bitly.handle(userActivity)
    }
    
    func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {
        return Bitly.handleOpen(url)
    }
}

麻烦各位帮忙看看问题出在哪里,非常感谢!

内容来源于stack exchange

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.07 10:43:08