首页 > 解决方案 > 接收失败并出现错误“软件导致连接中止”

问题描述

我收到此错误,应用程序连接丢失。从另一个应用程序重定向到我的应用程序时,我遇到了这个问题。此问题仅在实时应用程序上触发,连接丢失时出错,并且在使用 Xcode 调试时出错但成功重定向到特定视图控制器我使用带有 url 方案的深度链接来处理响应从另一个应用程序。由于无法调试实时应用程序问题,因此仍不清楚存在什么确切问题。在 AppDelegate 中使用 iOS 13.2:

func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {

let components = NSURLComponents(url: url, resolvingAgainstBaseURL: true)
let params = components?.queryItems
signedResponse = (params?.first(where:{$0.name == "signedResponse"})?.value)!

self.decodedMsgString = String(data:Data(base64Encoded: signedResponse)!,encoding:.utf8)!

print("decodedMsgString : \(decodedMsgString)")


//Call API here

return true

}

标签: iosswiftdeep-linkingappdelegateurlsession

解决方案


推荐阅读