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?
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?
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.
- (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];
}
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];
}
}