gpt4 book ai didi

ios - 找不到 FacebookSDK/FacebookSDK.h

转载 作者:行者123 更新时间:2023-12-01 18:52:22 26 4
gpt4 key购买 nike

我是一名 android 开发人员,我是 Xcode 和 Objective-c 的新手。

我在我的应用程序中使用 parse.com,我正在尝试添加使用面部登​​录的功能,但是,ParseFacebookUtils 的标题之一框架需要头文件FacebookSDK它不再包含在新的 Facebook SDK 中。

进一步调查显示我需要 FBSession header ,但我也找不到它。

有解决方案吗?我正在使用最新的 Xcode,解析 sdks 和 Facebook sdks。

编辑:

[PFFacebookUtils logInInBackgroundWithReadPermissions:@[@"public_profile", @"user_about_me", @"user_friends", @"email"] block:^(PFUser *user, NSError *error) {
NSLog(@"Im here anyway!");
if (!user) {
NSLog(@"Uh oh. The user cancelled the Facebook login.");
} else if (user.isNew) {
NSLog(@"User signed up and logged in through Facebook!");
} else {
NSLog(@"User logged in through Facebook!");
}
}];

编辑2:
//
// AppDelegate.m
// Listo
//
// Created by Amit Baz on 5/12/15.
// Copyright (c) 2015 Amit Baz. All rights reserved.
//

#import "AppDelegate.h"
#import <FBSDKCoreKit/FBSDKCoreKit.h>
#import <FBSDKLoginKit/FBSDKLoginKit.h>
#import <ParseFacebookUtilsV4/PFFacebookUtils.h>
#import <Parse/Parse.h>

@interface AppDelegate ()

@end

@implementation AppDelegate


- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after application launch.

[FBSDKLoginButton class];

[Parse setApplicationId:@""
clientKey:@""];

[PFFacebookUtils initializeFacebookWithApplicationLaunchOptions:launchOptions];

[PFAnalytics trackAppOpenedWithLaunchOptions:launchOptions];

return YES;
}

- (void)applicationWillResignActive:(UIApplication *)application {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
}

- (void)applicationDidEnterBackground:(UIApplication *)application {
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}

- (void)applicationWillEnterForeground:(UIApplication *)application {
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
}

- (void)applicationDidBecomeActive:(UIApplication *)application {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
[FBSDKAppEvents activateApp];
}

- (void)applicationWillTerminate:(UIApplication *)application {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {
return [[FBSDKApplicationDelegate sharedInstance] application:application
openURL:url
sourceApplication:sourceApplication
annotation:annotation];
}

@end

最佳答案

Parse 支持 Facebook SDK 的 v4.x 和 v3.x。如果您使用的是 Facebook SDK 的 v4.x,则不要导入 ParseFacebookUtils ,您需要:

#import <ParseFacebookUtilsV4/PFFacebookUtils.h>

https://www.parse.com/docs/ios/guide#fbusers了解更多信息。

关于ios - 找不到 FacebookSDK/FacebookSDK.h,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30175529/

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