1

I have shared an image on Whatsapp from an iOS app using UIDocumentInteractionController. But, right now, I need to share an image without using UIDocumentInteractionController. Is it possible?

Extra Savoir-Faire
  • 6,026
  • 4
  • 29
  • 47
user1667968
  • 1,489
  • 3
  • 12
  • 16

2 Answers2

4

It's not possible, since all apps are sandboxed the UIDocumentInteractionController is the only way to share files among apps.

Read the FAQ on integrate WhatsApp it only mentions UIDocumentInteractionController for sharing files (images, video and audio). You can if you only want WhatsApp to show up change the extension to of the file to:

  • 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
Chintan Patel
  • 3,175
  • 3
  • 30
  • 36
rckoenes
  • 69,092
  • 8
  • 134
  • 166
0

I don't see why you would not want to use the UIDocumentInteractionController. Maybe a temporary fix like this can help:

if ([[UIApplication sharedApplication] canOpenURL: [NSURL URLWithString:@"whatsapp://app"]])
{

}
iOSAaronDavid
  • 140
  • 15