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

}