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
相关产品推荐
相关产品推荐

