Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Facebook, Twitter icon not showing in UIActivityViewController on iOS7

I have added this code for presenting a UIActivityViewController:

-(IBAction)activityAction:(id)sender
{
    UIActivityViewController *activityViewController = [[UIActivityViewController alloc]initWithActivityItems:[NSArray arrayWithObjects:@"Hello Welcome!",[UIImage imageNamed:@"scene3.jpg"],nil] applicationActivities:nil];

     activityViewController.excludedActivityTypes = @[UIActivityTypePostToFacebook, UIActivityTypePostToTwitter, UIActivityTypePostToWeibo, UIActivityTypeAssignToContact];
    [self presentViewController:activityViewController animated:YES completion:nil];
}

Facebook, Twitter and Weibo icons are not showing in iOS7. In iOS6, all the icons are showing correctly. See the screenshot below:

enter image description here

How can I solve this?

like image 541
karthika Avatar asked Sep 23 '13 10:09

karthika


3 Answers

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.

like image 76
Marty Avatar answered Nov 14 '22 02:11

Marty


Look at the name of the property excludedActivityTypes, you are excluding facebook, twitter, ...

activityViewController.excludedActivityTypes = @[UIActivityTypePostToWeibo, UIActivityTypeAssignToContact];

excludes only Weibo and Assign to contact

like image 28
pNre Avatar answered Nov 14 '22 02:11

pNre


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.

like image 5
Nirmit Dagly Avatar answered Nov 14 '22 02:11

Nirmit Dagly