2012-05-03 16 views

答えて

0

Facebookから情報を取得するには、FBGraph APIを使用する必要があります。希望Linkあなたを助けることができます

0

あなたはそれつもりヘルプこの希望をお試しください: -

- (void)request:(FBRequest*)request didLoadRawResponse:(NSData*)data 
{ 

    NSString *profileString = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; 
    NSMutableDictionary *userinfo = [[profileString JSONValue] mutableCopy];//1451571176 

    [[NSUserDefaults standardUserDefaults] setObject:userinfo forKey:@"USER_INFO"]; 
    [[NSUserDefaults standardUserDefaults] synchronize]; 

    NSLog(@"user info:%@",userinfo); 

    userDictionary = [[NSUserDefaults standardUserDefaults] valueForKey:@"USER_INFO"]; 
    NSString *userIDString = [NSString stringWithFormat:[userDictionary valueForKey:@"id"]]; 
    NSLog(@"User: %@",userIDString); 
} 

は、それがその後、clarify.Thanksを喜ばないhelps.ifホープ:)

1

あなたはこれがあなたのために動作しますFBConnectのためにこれを使用する必要があります。

- (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; 
     } 
    } 
    } 


- (void)postToWall 
{ 
    FBStreamDialog *dialog = [[[FBStreamDialog alloc] init] autorelease]; 
    dialog.userMessagePrompt = @"Enter your message:"; 
    dialog.attachment = [NSString stringWithFormat:@"{\"name\":\"Facebook Connect for iPhone\",\"href\":\"http://developers.facebook.com/connect.php?tab=iphone\",\"caption\":\"Caption\",\"description\":\"Description\",\"media\":[{\"type\":\"image\",\"src\":\"http://img40.yfrog.com/img40/5914/iphoneconnectbtn.jpg\",\"href\":\"http://developers.facebook.com/connect.php?tab=iphone/\"}],\"properties\":{\"another link\":{\"text\":\"Facebook home page\",\"href\":\"http://www.facebook.com\"}}}"]; 
    [dialog show]; 
} 
+0

それがあなたに十分に役立つ場合は、私たちに知らせてください。 – vishiphone

+0

ありがとう@vishiphone – Aseem

+0

この投稿はあなたのために役立ちますし、私の答えの矢印をしてくださいまた、他の人に役立つように正しい答えにチェックしてください。 – vishiphone

関連する問題