Facebook SDK更改为登录弹出视图 [英] Facebook SDK changes to Login in Pop-up view

查看:167
本文介绍了Facebook SDK更改为登录弹出视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Facebook登录我的应用程序。因此,我已经安装了 Facebook SDK 。现在问题是我试图从SDK的SAMPLE代码开始,即 SessionLoginSample .Problem是登录它需要我到 SAFARI 进入credientials.is无法打开像PopUP View一样的登录页面(图2)...





图像1直接来到(SAFARI)..什么变化需要打开它像(图2)弹出。

   - (IBAction)buttonClickHandler:(id)sender {

SLAppDelegate * appDelegate = [[UIApplication sharedApplication] delegate];


if(appDelegate.session.isOpen){

[appDelegate.session closeAndClearTokenInformation];

} else {
if(appDelegate.session.state!= FBSessionStateCreated){

appDelegate.session = [[FBSession alloc] init];



[appDelegate.session openWithCompletionHandler:^(FBSession * session,
FBSessionState status,
NSError * error){
/ /这里我们确保根据新的会话状态更新我们的UX
[self updateView];
}];
}
}


解决方案

使用FBConnect,请参阅本教程...




I am Trying to Login my app with Facebook.For that reason I have Installed Facebook SDK. now Problem is I am trying to start with SAMPLEs code of SDK i.e SessionLoginSample .Problem is, to login Its takes me to the SAFARI to enter credientials.isn't it possible to open the login Page like PopUP View like(image 2)...

Image 1 is coming directly (SAFARI ) ..what changes required to open it like (image 2) pop up.

 - (IBAction)buttonClickHandler:(id)sender {

SLAppDelegate *appDelegate = [[UIApplication sharedApplication]delegate];


if (appDelegate.session.isOpen) {

    [appDelegate.session closeAndClearTokenInformation];

} else {
    if (appDelegate.session.state != FBSessionStateCreated) {

        appDelegate.session = [[FBSession alloc] init];
    }


    [appDelegate.session openWithCompletionHandler:^(FBSession *session, 
                                                     FBSessionState status, 
                                                     NSError *error) {
        // and here we make sure to update our UX according to the new session state
        [self updateView];
    }];
} 
 }

解决方案

Use FBConnect for that see this bellow tutorial...

iPhone-fbconnect-facebook-connect-tutorial

see the Login Dialog like bellow...

Just follow the instruction and create your id and use it..

Same but another tutorial with example see ...

This

这篇关于Facebook SDK更改为登录弹出视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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