我在构建xCode 7.3.1项目时遇到错误。
/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKApplicationDelegate.h:77:35:没有任何类型或协议命名' UIApplicationOpenURLOptionsKey'
问题func是这样的:
- (BOOL)application:(UIApplication *)application
openURL:(NSURL *)url
options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options;
需要你的帮助! THX ..
答案 0 :(得分:18)
最新的FBSDKCoreKit不适用于Xcode 7.3。您应该使用XCode 8或更早版本的Facebook框架。
- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<NSString *,id> *)options
已在XCode 8中替换为
- (BOOL)application:(UIApplication *)application
openURL:(NSURL *)url
options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options;
尝试使用此facebook SDK
https://origincache.facebook.com/developers/resources/?id=FacebookSDKs-iOS-4.14.0.zip
有关从iOS 9到10的更改的详细信息,请转到此链接https://developer.apple.com/library/content/releasenotes/General/iOS10APIDiffs/Objective-C/UIKit.html
答案 1 :(得分:0)
而不是这段代码:
- (BOOL)application:(UIApplication *)application
openURL:(NSURL *)url
options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options {
BOOL handled = [[FBSDKApplicationDelegate sharedInstance] application:application
openURL:url
sourceApplication:options[UIApplicationOpenURLOptionsSourceApplicationKey]
annotation:options[UIApplicationOpenURLOptionsAnnotationKey]
];
// Add any custom logic here.
return handled;
}
使用此代码:
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {
return [[FBSDKApplicationDelegate sharedInstance] application:application
openURL:url
sourceApplication:sourceApplication
annotation:annotation
];
}
答案 2 :(得分:0)
试试这段代码:
- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options {
return [[FBSDKApplicationDelegate sharedInstance] application:app openURL:url options:options];
}