所以我尝试在iOS应用程序中使用深度链接(注意,这里的域名是一个虚拟值):
static let redirectUrlStr = "domain://domain:success"和
private let redirectUrl = URL(string: .redirectUrlStr)!我将此作为重定向传递给一个AppAuth请求:
let request = OIDTokenRequest(configuration: config!,
grantType: .refreshGrantType,
authorizationCode: nil,
redirectURL: self.redirectUrl,
clientID: .clientId,
clientSecret: nil,
scopes: [OIDScopeOpenID, OIDScopeProfile, OIDScopeEmail],
refreshToken: userCredentials.refreshToken,
codeVerifier: nil,
additionalParameters: nil)这部分似乎都起作用了,如果我传入一个像google.com这样的重定向URL,就会重定向到google works。
然而,当尝试使用深度链接时,我得到了上面的错误。
我想这应该行得通-
我已经在Xcode的capabilities部分启用了关联域:
applinks:domain.com
我已经在Apple Developer的App ID中启用了相关域名
这里缺少什么?我需要一个apple-app-site-association文件吗?
我以前只用过deeplinking一次,所以我不太清楚我可能会错过什么。
还有一个包含相关联的域信息的授权文件。
发布于 2018-10-31 16:25:12
我认为这可能与你的应用程序的URL方案处理有关。如果你不更新你的plist来通知操作系统你对domain网址方案的处理,那么它将被视为输入错误的网址。尝试将domain添加到Info.plist文件的URL Types -> URL Schemes中。您可以通过以下方式执行此操作:
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLName</key>
<string>com.domain</string>
<key>CFBundleURLSchemes</key>
<array>
<string>domain</string>
</array>
</dict>
</array>希望这能有所帮助。
发布于 2018-11-06 01:38:12
答案是,由于URL方案标识符已经存在于App Store中,它被认为是重复的,这导致了Apple所描述的“奇怪的行为”。
切换到更唯一的URL方案标识符立即解决了这个问题。
https://stackoverflow.com/questions/52993052
复制相似问题