FBログインを実装しましたが、コールバックを取得していません... .plistに FacebookAppID と FacebookDisplayName を追加しました
これが私のコードです。私の質問からのすべての関連コード
-(IBAction)btnLoginWithFBClick:(id)sender {
_session = [[FBSession sessionForApplication:kApiKey secret:kApiSecret delegate:self] retain];
[_session resume];
if (![_session isConnected]) {
_loginDialog = nil;
_loginDialog = [[FBLoginDialog alloc] init];
_loginDialog.delegate = self;
[_loginDialog show];
}
else {
NSLog(@"logado");
- (void)dialogDidSucceed:(FBDialog *)dialog {
if ([dialog isMemberOfClass:[FBLoginDialog class]]) {
NSLog(@"[FBLoginDialog::dialogDidSucceed] just did succeed");
} else if ([dialog isMemberOfClass:[FBPermissionDialog class]]) {
NSLog(@"[FBPermissionDialog::dialogDidSucceed] update user status");
// [self facebookUpdateUserStatus];
}
}
- (void)session:(FBSession*)session didLogin:(FBUID)uid {
[self getFacebookName];
[_loginDialog setHidden:YES];
}
- (void)session:(FBSession*)session willLogout:(FBUID)uid {
//_logoutButton.hidden = YES;
_facebookName = nil;
}
- (void)getFacebookName {
NSString* fql = [NSString stringWithFormat:
@"select uid,name, email, sex, pic from user where uid == %lld", _session.uid];
NSDictionary* params = [NSDictionary dictionaryWithObject:fql forKey:@"query"];
[[FBRequest requestWithDelegate:self] call:@"facebook.fql.query" params:params];
}
- (void)dialogCompleteWithUrl:(NSURL *)url {
if (![[url absoluteString] isEqualToString:@"fbconnect://success#="]) { // your msg
NSLog(@"ae");
}
}
- (void)request:(FBRequest*)request didLoad:(id)result {
if ([request.method isEqualToString:@"facebook.fql.query"]) {
NSArray* users = result;
NSDictionary* user = [users objectAtIndex:0];
NSLog(@"Usuario facebook: %@", user);
NSString *identifier = [user objectForKey:@"uid"];
NSString *name = [user objectForKey:@"name"];
NSString *email = [user objectForKey:@"email"];
NSString *sex = [user objectForKey:@"sex"];
}
}
Facebook アプリケーションで Apple Id 、Bundle ID などを設定しました。Google で解決策を探しましたが、何も機能しません...何か考えはありますか?