I have added this code for presenting a UIActivityViewController
:
-(IBAction)activityAction:(id)sender
{
UIActivityViewController *activityV
You're probably not logged in to Facebook or Twitter in the devices Settings. They won't show up here unless the user is logged in. File a bug with Apple.
Look at the name of the property excludedActivityTypes
, you are excluding facebook, twitter, ...
activityViewController.excludedActivityTypes = @[UIActivityTypePostToWeibo, UIActivityTypeAssignToContact];
excludes only Weibo and Assign to contact
Make sure that you don't exclude the Activities that you want to use. So, remove "UIActivityTypePostToFacebook" & "UIActivityTypePostToTwitter" from "activityViewController.excludedActivityTypes" object.
Also, Make sure that you are logged in into Facebook and Twitter accounts in order to post on respective social platform.
Please note that this is working on simulator and real devices.
Hope this helps you.
Your code,
activityViewController.excludedActivityTypes = @[UIActivityTypePostToFacebook, UIActivityTypePostToTwitter, UIActivityTypePostToWeibo, UIActivityTypeAssignToContact];
Change to this,
activityViewController.excludedActivityTypes = @[UIActivityTypePostToWeibo, UIActivityTypeAssignToContact];
And if you have to logged into facebook, twitter on your device settings. Then only it will be visible.
Thanks,
Don't include UIActivityTypePostToFacebook in
activityViewController.excludedActivityTypes = @[UIActivityTypePostToTwitter, UIActivityTypePostToWeibo, UIActivityTypeAssignToContact];
[self presentViewController:activityViewController animated:YES completion:nil];