Facebook登录要安装(iPhone) [英] Facebook Login ask to install (iPhone)
问题描述
我需要在iOS 6的 Facebook-SDK-3.1
的Facebook登录中的帮助。我使用了 Facebook sdk的所有代码
示例代码 sessionLoginSample
,我已经使用了 WebView
开头的代码,每当我从新的ID ...它需要我到下面的图像链接到安装
在我的项目
.dont知道什么是它是...如果我这样做,然后从代码中的注销
。当我再次按按钮登录时,它自动日志-in
而不要求 id和pssword``login页面
。再次,它也会自动登录,即使在注销之后,任何人都可以帮助我,为什么在注销后,它会要求存储先前的访问令牌和密码。
和代码是
- (IBAction)buttonClickHandler:(id)sender {
AppDelegate * appDelegate = [[UIApplication sharedApplication] delegate];
if(appDelegate.session.isOpen){
[appDelegate.session closeAndClearTokenInformation];
} else {
if(appDelegate.session.state!= FBSessionStateCreated){
appDelegate.session = [[FBSession alloc] initWithPermissions:[NSArray arrayWithObjects: @email,nil]];
[appDelegate.session openWithBehavior:FBSessionLoginBehaviorForcingWebView
completionHandler:^(FBSession * session,
FBSessionState state ,
NSError * error){
FBSession.activeSession = session;
[self updateView];
NSLog(@state =%d,state);
[FBRequestConnection
startForMeWithCompletionHandler:^(FBRequestConnection * connection,
id< FBGraphUser> user,
NSError * error){
userInfo = @;
userInfo = user.username;
NSLog(@string%@,userInfo);
[self checkfacebook];
}];
}]; }
}
解决方案访问您的应用程序一旦用户登录。如果用户想要修改他可以通过登录到fb并更改权限来执行的权限。您可能想查看oAuth了解更多详情。
I need help in the facebook login from Facebook-SDK-3.1
for iOS 6.I have used all the code of the Facebook sdk
sample code sessionLoginSample
,I have used the WebView
opening code in this and whenever i login from the new id ...it takes me to the below image link to install
in my project
.dont know what exactly it is...and if i do so and after that logout
from the code ..and when I again press button to login , it automatically log-in
without asking for the id and pssword``login page
. and again again it automatically logs-in , even after logout./.can anyone help me why after being logout it ask stores the previous access token and password.
and code is
- (IBAction)buttonClickHandler:(id)sender {
AppDelegate* appDelegate = [[UIApplication sharedApplication]delegate];
if (appDelegate.session.isOpen) {
[appDelegate.session closeAndClearTokenInformation];
} else {
if (appDelegate.session.state != FBSessionStateCreated) {
appDelegate.session = [[FBSession alloc] initWithPermissions:[NSArray arrayWithObjects:@"email", nil]];
}
[appDelegate.session openWithBehavior:FBSessionLoginBehaviorForcingWebView
completionHandler:^(FBSession *session,
FBSessionState state,
NSError *error) {
FBSession.activeSession = session;
[self updateView];
NSLog(@" state=%d",state);
[FBRequestConnection
startForMeWithCompletionHandler:^(FBRequestConnection *connection,
id<FBGraphUser> user,
NSError *error) {
userInfo = @"";
userInfo = user.username;
NSLog(@"string %@", userInfo);
[self checkfacebook];
}];
}]; }
}
FB grants access to your app once the user logs in . If the user wants to modify the privileges he can do it by loggin into fb and changing permissions. You might want to look into oAuth for further details.
这篇关于Facebook登录要安装(iPhone)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!