0

In iOS 7, is it possible to customize the UIActivityViewController (sample image shown below) such that only a few apps are displayed? For instance, we only want to show iMessage, WeChat, Line, KaKao, Skype, Kik, and Facebook Messenger (not Facebook proper).

Our goal is to permit sharing of images from our app to other apps, but we want to simplify the interface as much as possible and only show supported apps. Nothing more.

From the Apple documentation, it's clear how to exclude actions like saving to the camera roll or assigning to contact or printing, but what if we want to exclude the top row (i.e., AirDrop) and bottom row (i.e., share actions) altogether?

Is this possible?

enter image description here

Crashalot
  • 33,605
  • 61
  • 269
  • 439
  • 1
    did you check this? http://stackoverflow.com/questions/19486850/exclude-airdrop-and-add-to-reading-list-from-apps-build-with-ios-6-sdk – tiguero Jul 22 '14 at 14:42

2 Answers2

1

Yes. It's what the second param (applicationActivities) of this does:

- (id)initWithActivityItems:(NSArray *)activityItems applicationActivities:(NSArray *)applicationActivities;

Hand it an array of these, determine the services it presents.

danh
  • 62,181
  • 10
  • 95
  • 136
  • cool, thanks! also is it possible to control the order that the apps appear? or should this be a separate question? – Crashalot Jul 22 '14 at 15:04
  • seems related... I haven't tested this but pretty sure you can control order via the order of the passed array. – danh Jul 22 '14 at 15:06
  • thanks again, @danh! the doc you provided only lists certain apps like weibo and twitter. how do we identify the end points for apps like kakao, line, whatsapp, skype, and other apps? – Crashalot Jul 23 '14 at 07:53
  • I think the sdk is limited to apps that apple has chosen to support. – danh Jul 23 '14 at 13:46
  • hmm weird bc some apps like https://itunes.apple.com/us/app/big-emoji-for-texting-facebook/id501840899?mt=8 support path kakao line and others. no clue how they do it? – Crashalot Jul 24 '14 at 06:57
1

Look like all you need to do is to set properly the excludedActivityTypes property. Check this and my comment.

tiguero
  • 11,477
  • 5
  • 43
  • 61