1

I use this piece of code, but it shows other apps.

NSURL *URL = [[NSBundle mainBundle] URLForResource:@"ABC" withExtension:@"png"];
if (URL)
{
   self.documentInteractionController = [UIDocumentInteractionController interactionControllerWithURL:URL];
   [self.documentInteractionController setDelegate:self];
   CGRect rect = self.view.frame;
   [self.documentInteractionController presentOpenInMenuFromRect:rect inView:self.view animated:YES];

How can I show the WhatsApp icon only?

Pang
  • 9,564
  • 146
  • 81
  • 122
user3667646
  • 95
  • 3
  • 7

1 Answers1

1

Here are the WhatsApp developer docs: https://www.whatsapp.com/faq/iphone/23559013

Here is the relevant bit:

Alternatively, if you want to show only WhatsApp in the application list (instead of WhatsApp plus any other public/*-conforming apps) you can specify a file of one of aforementioned types saved with the extension that is exclusive to WhatsApp:

images - «.wai» which is of type net.whatsapp.image

videos - «.wam» which is of type net.whatsapp.movie

audio files - «.waa» which is of type net.whatsapp.audio

So in order to share an image you would set the UTI of your UIDocumentInteractionController to net.whatsapp.image and append the extension .wai to your filepath.

Additionally, this question may have some helpful example code.

Community
  • 1
  • 1
Dima
  • 23,484
  • 6
  • 56
  • 83
  • The code you posted does not include the part where you save the file in the first place. That is necessary in order to save it with a different name, can you edit your question and include the rest of the code? – Dima May 23 '14 at 15:23