8

Apparently iOS8 by default adds a "iCloud Photo Sharing" activity to activity views in iOS8 and I haven't found any useful documentation regarding it, especially how to explicitly remove it (going into the "More" option allows the user to toggle showing/hiding it, but for our app we want to completely disallow this option).

Has anyone figured anything out about how to disable this? Any input would be appreciated. Thanks!

Activity VC with unwanted "iCloud Photo Sharing" option

"More" option with user-performed manual enable/disable

Brendan Cain
  • 272
  • 4
  • 11
  • FYI - I'd like to remove "iCloud Photo Sharing" as well. I tried adding the following string values but none of them worked. "com.apple.UIKit.activity.iCloudPhotoSharing", "com.apple.UIKit.activity.PhotoSharing", "com.apple.UIKit.activity.ICloudPhotoSharing", "com.apple.UIKit.activity.iCloud", "com.apple.UIKit.activity.iCloudPhoto", "com.apple.UIKit.activity.iCloudSharing", "iCloudPhotoSharing". – rmaddy Nov 30 '14 at 01:07
  • The `activityType` is `@"com.apple.mobileslideshow.StreamShareService"`. However this does nothing when added to the excludes list. – OrangeDog Jan 22 '15 at 14:00
  • **Easily done here** ... http://stackoverflow.com/a/37217699/294884 – Fattie Aug 03 '16 at 17:04
  • 3
    Possible duplicate of [How to exclude Notes and Reminders apps from the UIActivityViewController?](http://stackoverflow.com/questions/31792506/how-to-exclude-notes-and-reminders-apps-from-the-uiactivityviewcontroller) – Fattie Aug 03 '16 at 17:04

2 Answers2

6

If you init your UIActivityViewController with full of images, iCloud sharing set to activity types by default. You can add a string in your activityItems array. This move will cause that iCloud sharing to be removed from activityTypes.

NSArray *Items   = [NSArray arrayWithObjects: image1, image2, @"", nil];
UIActivityViewController *activityViewController = [[UIActivityViewController alloc] initWithActivityItems:Items applicationActivities:nil];
SdkKml
  • 61
  • 1
  • 3
  • Mildly hacky solution, but it works. This is especially if you use a `UIActivityItemSource` and want image type activities to show up – Dan F Dec 11 '14 at 18:47
  • 1
    Then have to exclude `UIActivityTypeCopyToPasteboard`, as that will just copy the empty string. – OrangeDog Jan 22 '15 at 14:31
  • You can keep pasteboard functionality if you replace the empty string activity item with a custom UIActivityItemProvider that returns a nil item and has an empty string as its placeholder item. – Matt Comi Oct 19 '16 at 10:12
2

Normally you'd set the excludedActivityTypes property on your UIActivityViewController instance -- e.g., to exclude posting to Facebook, you'd put UIActivityTypePostToFacebook in that array.

But it doesn't look like the Built-in Activity Types list (either in the documentation or in UIActiviy.h) includes a constant for iCloud Photos. That's probably worth filing a bug about.

rickster
  • 124,678
  • 26
  • 272
  • 326