Isuru
Isuru

Reputation: 31323

ActivityItems in UIActivityViewController don't show up

I'm developing an app in iOS 7 and in it I need to show an activity controller. Below is my code,

UIActivityViewController *activityVC = [[UIActivityViewController alloc] initWithActivityItems:@[UIActivityTypeSaveToCameraRoll, UIActivityTypePostToFacebook, UIActivityTypePostToTwitter, UIActivityTypeMail, UIActivityTypeMessage, UIActivityTypePrint] applicationActivities:nil];
    [self presentViewController:activityVC animated:YES completion:nil];

But when its presented, this is how it looks.

enter image description here

None of the activity types I added in the array shows up. Why is this happening? Am I missing something? I'd like some help to get this working. I especially need the Facebook, twitter sharing and the saving to the local storage options here.

Thank you.

Edit: I checked on a real device and the Facebook and Twitter sharing options show up. However UIActivityTypeSaveToCameraRoll, UIActivityTypePrint still aren't showing up.

Upvotes: 0

Views: 2182

Answers (1)

Spidy
Spidy

Reputation: 1146

The Items will show up only if you have integrated them to your Device. If you have integrated facebook and Logged into facebook in the settings then Facebook will appear along the Items. That means your device must be Synchronised with the native Facebook, Twitter, etc Apps for them to show up in the UIActivityViewController

Edit:

Try using like this

UIActivityViewController *ActivityView;
ActivityView =
[[UIActivityViewController alloc]
 initWithActivityItems:Items applicationActivities:nil];

[self presentViewController:ActivityView animated:YES completion:nil];

Upvotes: 1

Related Questions