0

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.

Isuru
  • 30,617
  • 60
  • 187
  • 303
  • possible duplicate of [UIActivityViewController doesn't show FB and Twitter on iOS 7](http://stackoverflow.com/questions/18987596/uiactivityviewcontroller-doesnt-show-fb-and-twitter-on-ios-7) – Petro Korienev Mar 04 '14 at 08:47

1 Answers1

1

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];
Spidy
  • 1,137
  • 3
  • 28
  • 48
  • I just checked in a real device and you're right. It woks in a real device. However `UIActivityTypeSaveToCameraRoll` doesn't show up in either simulator or in the real device. Any idea why? – Isuru Mar 04 '14 at 08:47
  • @Isuru Try this. Also Items is the content that you want to share. – Spidy Mar 04 '14 at 08:55