gpt4 book ai didi

swift - FBSDKApplicationDelegate 申请openURL :sourceApplication:annotation deprecated

转载 作者:IT王子 更新时间:2023-10-29 05:13:58 28 4
gpt4 key购买 nike

不推荐使用 iOS9 应用程序 openURL:sourceApplication:annotation

func application(application: UIApplication, openURL url: NSURL, sourceApplication: String?, annotation: AnyObject?) -> Bool {
return FBSDKApplicationDelegate.sharedInstance().application(application, openURL: url, sourceApplication: sourceApplication, annotation: annotation)
}

所以现在我们应该使用;

func application(app: UIApplication, openURL url: NSURL, options: [String : AnyObject]) -> Bool {}

FBSDKApplicationDelegate sourceApplication 参数(String) 设置什么

最佳答案

func application(app: UIApplication, openURL url: NSURL, options: [String : AnyObject]) -> Bool
{
return FBAppCall.handleOpenURL(url, sourceApplication: options["UIApplicationOpenURLOptionsSourceApplicationKey"] as! String)
}

如果您的 SDK 中有注释参数,则传递为 nil

新SDK

   let sourceApplication: String? = options[UIApplicationOpenURLOptionsSourceApplicationKey] as? String 
return FBSDKApplicationDelegate.sharedInstance().application(app, openURL: url, sourceApplication: sourceApplication, annotation: nil)

2017/04/06 更新:Xcode 8.3、FBSDKCoreKit 4.20.2

func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -> Bool {
let sourceApplication: String? = options[UIApplicationOpenURLOptionsKey.sourceApplication] as? String
return FBSDKApplicationDelegate.sharedInstance().application(app, open: url, sourceApplication: sourceApplication, annotation: nil)
}

关于swift - FBSDKApplicationDelegate 申请openURL :sourceApplication:annotation deprecated,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33737403/

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