gpt4 book ai didi

ios - AppDelegate 中未调用应用程序 openURL 函数

转载 作者:行者123 更新时间:2023-12-01 16:24:32 25 4
gpt4 key购买 nike

所以,在我的 Swift 应用程序中,我正在使用 this sdk 进行 SoundCloud 身份验证。 .我在 info.plist 中将重定向 URI 设置为 appname,并且在 SC 网站上将 SoundCloud 重定向 URI 设置为 appname://authorized。但是,我在应用程序委托(delegate)中的函数在登录后没有被调用。我有什么遗漏吗?

func application(application: UIApplication, openURL url: NSURL, sourceApplication: String?, annotation: AnyObject) -> Bool {
print("function called")

return true
}

这是我应该实现的正确功能吗?

最佳答案

该方法已被弃用。

https://developer.apple.com/documentation/uikit/uiapplicationdelegate/1623073-application

使用 application(_:open:options:) 代替:
https://developer.apple.com/documentation/uikit/uiapplicationdelegate/1623112-application

func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any]) -> Bool {
return true
}

关于ios - AppDelegate 中未调用应用程序 openURL 函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36845793/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com