简体   繁体   English

在当前Facebook SDK中找不到FBLoginView和FBSession

[英]FBLoginView and FBSession not found in current Facebook SDK

I am building an app with Facebook integration. 我正在构建一个与Facebook集成的应用程序。 I downloaded the latest version of Facebook SDK from https://developers.facebook.com/docs/ios/getting-started 我从https://developers.facebook.com/docs/ios/getting-started下载了最新版本的Facebook SDK

I got the login/logout working following the instructions on Facebook website. 我按照Facebook网站上的说明进行了登录/注销。

Now I want to customize the Login button as well as check if the user has already logged in then the app should load the home screen on startup. 现在,我想自定义“登录”按钮,以及检查用户是否已经登录,那么应用程序应在启动时加载主屏幕。 For this I looked up for code online and most of them use FBLoginView and FBSession which is not available in the SDK I downloaded. 为此,我在线查找了代码,其中大多数使用了FBLoginViewFBSession ,这些在我下载的SDK中不可用。

I also tried looking for FacebookSDKResource.bundle as suggested online, but even this is not available in the SDK. 我也尝试过按照在线建议的方法查找FacebookSDKResource.bundle ,但SDK中甚至不提供此功能。

Can anyone suggest a way to use FBLoginView and FBSession or any alternative to these classes for the latest SDK? 谁能为最新的SDK建议使用FBLoginViewFBSession或这些类的替代方法的方法?

How do I make custom login button and check if the user has logged in ? 如何制作custom login buttoncheck if the user has logged in

to check if user is logged in im currently doing next 检查用户是否登录即时消息当前正在做下一步

if ([FBSDKProfile currentProfile]) {
   NSLog("is logged in");
}

Using FBSDKCoreKit.framework 使用FBSDKCoreKit.framework

I don't know if there is another way... 我不知道还有没有其他办法

Of course, first i use FBSDKLoginManager to perform login... 当然,首先我要使用FBSDKLoginManager来执行登录...

To make a custom button for login, simply make a UIButton with a IBAction to manage the login... 要创建用于登录的自定义按钮,只需使用带有IBAction的UIButton来管理登录...

This is the library you're looking for. 这是您要查找的库。 It's not the most up to date but has the classes you mentioned. 它不是最新的,但具有您提到的课程。

https://github.com/facebook/facebook-ios-sdk https://github.com/facebook/facebook-ios-sdk

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM