FBLoginView iPhone视图 [英] FBLoginView iPhone View

查看:345
本文介绍了FBLoginView iPhone视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在当前的3.1 Facebook SDK中使用FBLoginView并不能产生我认为它应该作为输出产生的东西。生成基本[[FBLoginView alloc] init];并且框架是当前视图控制器框架的大小,它只显示下面没有登录按钮:

Using the FBLoginView in the current 3.1 Facebook SDK doesn't produce what I believe it should be producing as an output. Generating a basic [[FBLoginView alloc] init]; and the frame the size of the current view controllers frame, it only shows the below WITHOUT the "Login" button:

http://cl.ly/image/1t102j1t452l

制作FBLoginView需要什么正确显示?

What does it take to make the FBLoginView show properly?

推荐答案

试试这个:

在.h文件中:

Use this delegate <FBLoginViewDelegate>

FBLoginView *loginview;

someMethod中的In.m文件:

In.m file in someMethod:

if(!loginView)
 loginView = [[FBLoginView alloc] initWithPermissions:[NSArray arrayWithObject:@"publish_actions, user_photos,status_update"]]; // Whatever permissions you need

loginview.frame = self.view.bounds; //whatever you want

loginview.delegate = self;

[self.view addSubview:loginview];

添加以下方法:

- (void)loginViewShowingLoggedInUser:(FBLoginView *)loginView {

    NSLog(@"Logged In");

}

- (void)loginViewFetchedUserInfo:(FBLoginView *)loginView
                            user:(id<FBGraphUser>)user {
NSLog(@"user Id %@",user.id);

}
- (void)loginViewShowingLoggedOutUser:(FBLoginView *)loginView {
    // Called after logout
    NSLog(@"Logged out");
}

希望这有帮助。

这篇关于FBLoginView iPhone视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆