如何在iOS 5中整合Facebook?

问题描述:

我知道Apple创建社交框架,但我的应用仅适用于iOS 5,所以我需要知道哪些是其他方法来实现它?如何在iOS 5中整合Facebook?

+1

你检查https://developers.facebook.com/ios/ – vqdave 2013-02-14 20:06:14

+0

可以使用Sharekit或使用Facebook IOS SDK .. – lakesh 2013-02-15 02:19:01

快速谷歌搜索了我的权利facebook的API开发者网站与信息,用于在用户墙张贴的文字和图片,网址这个题目

FacebookIOSTutorial

+0

谢谢我会检查出来 – iPive 2013-02-19 04:39:08

社会框架。 有使用它的代码。添加import语句

#import <Social/Social.h> 
- (IBAction)postToFacebook 
{ 
spinner.hidden=YES; 
if([SLComposeViewController isAvailableForServiceType:SLServiceTypeFacebook]) 
{ 
    SLComposeViewController *controller = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeFacebook]; 

    [controller setInitialText:@"Check this Beautiful App of ASI Delhi Circle"]; 
    //[controller addImage:imageView1.image]; 
    [controller addURL:[NSURL URLWithString:@"http://play.google.com/store/apps/details?id=com.asidelhicircle"]]; 
    [self presentViewController:controller animated:YES completion:Nil]; 
}else 
{ 
    UIAlertView *alert=[[UIAlertView alloc] initWithTitle:nil message:@"Please Login in Facebook application." delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil]; 

    [alert show]; 
    [alert release]; 
} 

}

- (IBAction)postToTwitter 
{ 
    if ([SLComposeViewController isAvailableForServiceType:SLServiceTypeTwitter]) 
    { 
    SLComposeViewController *tweetSheet = [SLComposeViewController 
              composeViewControllerForServiceType:SLServiceTypeTwitter]; 
     [tweetSheet setInitialText:@"Check this Beautiful App of ASI Delhi Circle http://play.google.com/store/apps/details?id=com.asidelhicircle"]; 
    [self presentViewController:tweetSheet animated:YES completion:nil]; 
}else 
{ 
    UIAlertView *alert=[[UIAlertView alloc] initWithTitle:nil message:@"Please Login in Twitter application." delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil]; 

    [alert show]; 
    [alert release]; 
} 

}