如何在iOS6中获取facebook,twitter个人资料(姓名,图像)

时间:2012-10-30 21:57:24

标签: iphone ipad ios6

我已经为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];
}
}

1 个答案:

答案 0 :(得分:0)

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

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