0

我已经为 ios6 实现了 facebook 和 twitter,但我没有获得用户详细信息,如姓名、电子邮件、图像。有人会帮助我吗?下面是我的代码:

-(IBAction)facebook
{   
    SLComposeViewController *fbController=[SLComposeViewController composeViewControllerForServiceType:SLServiceTypeFacebook];


    if([SLComposeViewController isAvailableForServiceType:SLServiceTypeFacebook])
    {
        SLComposeViewControllerCompletionHandler __block completionHandler=^(SLComposeViewControllerResult result){

            [fbController dismissViewControllerAnimated:YES completion:nil];


        switch(result){
            case SLComposeViewControllerResultCancelled:
            default:
            {
                NSLog(@"Cancelled.....facebook");

            }
                break;
            case SLComposeViewControllerResultDone:
            {
                NSLog(@"Posted....facebook");
            }
                break;
        }};

    [fbController addImage:[UIImage imageNamed:@"ipadicon_72x72.png"]];
    [fbController setInitialText:@"Check out this article."];

    //[fbController addURL:[NSURL URLWithString:@"http://soulwithmobiletechnology.blogspot.com/"]];
    [fbController setCompletionHandler:completionHandler];
    [self presentViewController:fbController animated:YES completion:nil];
}
}
4

1 回答 1

0

请参阅有关使用 Twitter 框架以及如何从 Twitter 获取信息的信息,具体而言,请参阅步骤 7

http://mobile.tutsplus.com/tutorials/iphone/ios-sdk_twitter-framework_twrequest/

于 2012-11-09T19:55:45.217 回答