0

Is there any built-in api/code for Xcode that allow the app to detect what other social media apps installed in the iphone/ipad/ipod touch to populate out the sharing features?

I was told that Android has such capability, so does iOS have it too?

ElasticThoughts
  • 3,417
  • 8
  • 43
  • 58
  • Best and the easiest way doing that is (I was looking for hours) http://stackoverflow.com/questions/13287007/social-action-sheet-like-on-ios-6 – makkuzu Sep 04 '14 at 14:11

3 Answers3

5

Twitter integration is built into iOS 5, check this link http://developer.apple.com/library/ios/documentation/Twitter/Reference/TWTweetSheetViewControllerClassRef/Reference/Reference.html

For Facebook you need to use the Facebook SDK, check here http://developers.facebook.com/docs/reference/iossdk/

Alternatively you could try ShareKit... http://getsharekit.com/

Or GetSocialize... http://www.GetSocialize.com/

Both of these offer drop in functionality.

ElasticThoughts
  • 3,417
  • 8
  • 43
  • 58
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 =@[UIActivityTypeCopyToPasteboard, UIActivityTypePostToWeibo, UIActivityTypePostToTwitter, UIActivityTypePostToWeibo];


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

}

Matt
  • 14,906
  • 27
  • 99
  • 149
0

Share Image Social Network Using UIActivityViewController:

-(void)shareimage {

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

avc.excludedActivityTypes=@[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];
}

}

Ramani Hitesh
  • 214
  • 3
  • 15