0

是否有任何内置的Xcode /代码,允许应用程序检测iPhone/ipad/ipod touch中安装的其他社交媒体应用程序来填充共享功能?Xcode社交媒体分享按钮

有人告诉我,Android有这样的能力,iOS也有这样的能力吗?

+0

最好的和做是最简单的方法(我正在寻找小时)http://stackoverflow.com/questions/13287007/social-action-sheet -like-on-ios-6 – makkuzu

回答

5

Twitter的整合内置的iOS 5,检查此链接http://developer.apple.com/library/ios/documentation/Twitter/Reference/TWTweetSheetViewControllerClassRef/Reference/Reference.html

对于Facebook来说,你需要使用Facebook SDK,点击这里http://developers.facebook.com/docs/reference/iossdk/

您也可以试试ShareKit ... http://getsharekit.com/

或GetSocialize ... http://www.GetSocialize.com/

这两个都提供功能下降。

+0

thx,将检查ShareKit和GetSocialize。在ShareKit和GetSocialize中,哪一个更常用? –

+0

我不确定哪一个有更多的市场份额。 – ElasticThoughts

+0

[iOS 6](https://developer.apple.com/technologies/ios6/)将提供Facebook集成。 – Adam

1
- (IBAction) shareHasTapped: (id)sender { 

    NSString *texttoshare = @"text to share"; 

    // UIImage *imagetoshare = [UIImage imageNamed:@"beck.png"]; 

    NSArray *activityItems = @[texttoshare]; 

    UIActivityViewController *activityVC = [[UIActivityViewController alloc] initWithActivityItems:activityItems applicationActivities:nil]; 

    activityVC.excludedActivityTypes [email protected][UIActivityTypeCopyToPasteboard, UIActivityTypePostToWeibo, UIActivityTypePostToTwitter, UIActivityTypePostToWeibo]; 


[self presentViewController:activityVC animated:TRUE completion:nil]; 

}

0

分享图片社交网络使用UIActivityViewController:

- (无效)shareimage {

NSArray *objectsToShare = @[_s_image]; 
UIActivityViewController * avc = [[UIActivityViewController alloc] initWithActivityItems:objectsToShare applicationActivities:nil]; 

[email protected][UIActivityTypePostToTwitter]; 
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) { 
    [self presentViewController:avc animated:YES completion:nil]; 
} 
else 
{ 
    UIPopoverController *popup = [[UIPopoverController alloc] initWithContentViewController:avc]; 
    [popup presentPopoverFromRect:CGRectMake(self.view.frame.size.width/2, self.view.frame.size.height/4, 0, 0)inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES]; 
} 

}