アプリでFBConnectに正常に接続しましたが、ユーザーがログインから正常にログインしViewController
たら開く必要があるように接続したいのですが、コードを使用してアプリに入力する場所..
AppDelegate *appdelegte =(AppDelegate*)[[UIApplication sharedApplication]delegate];
[[[appdelegte navigationController] view]removeFromSuperview];
[[appdelegte window]addSubview:[[appdelegte tabBarController]view]];
[[appdelegte tabBarController]setSelectedIndex:0];
これは入力する私のコードになります:-bしかし、Fbconnectコードでこれを使用する場所
- (void)session:(FBSession*)session didLogin:(FBUID)uid {
NSString* fql = [NSString stringWithFormat:
@"select uid,name from user where uid == %lld", self.usersession.uid];
NSDictionary* params = [NSDictionary dictionaryWithObject:fql forKey:@"query"];
[[FBRequest requestWithDelegate:self] call:@"facebook.fql.query" params:params];
self.post=YES;
self.usersession =session;
NSLog(@"User with id %lld logged in.", uid);
[self getFacebookName];
}
- (void)getFacebookName {
NSString* fql = [NSString stringWithFormat:
@"select uid,name from user where uid == %lld", self.usersession.uid];
NSDictionary* params = [NSDictionary dictionaryWithObject:fql forKey:@"query"];
[[FBRequest requestWithDelegate:self] call:@"facebook.fql.query" params:params];
self.post=YES;
}
- (void)request:(FBRequest*)request didLoad:(id)result {
if ([request.method isEqualToString:@"facebook.fql.query"]) {
NSArray* users = result;
NSDictionary* user = [users objectAtIndex:0];
NSString* name = [user objectForKey:@"name"];
self.username = name;
if (self.post) {
[self postToWall];
self.post = NO;
}
}
}
fbconnect からのログインに成功した後、アプリに入る方法を教えてください。