-7

Ive searched more but couldn't find any sample code of sharing video on WhatsApp. Please refer me sample code of sharing video on WhatsApp.

I've read http://www.whatsapp.com/faq/en/iphone/23559013 and https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIDocumentInteractionController_class/index.html.

But unable to understand that what actually will do for video sharing. Any help would be appreciated. Thanks in advance.

AltafBangash
  • 129
  • 3
  • 10
  • see my edited code... something like that .. for more details chekc here:-http://stackoverflow.com/questions/20417047/whatsapp-image-sharing-ios?rq=1 – Sri Oct 22 '14 at 09:28
  • already accepted answer is ther for vidoe sharing :- http://stackoverflow.com/questions/24161321/share-video-on-whatsapp-objective-c?rq=1 u asked SAME question here also... – Sri Oct 22 '14 at 09:33

2 Answers2

3

Document Interaction

If your application creates photos, videos, or audio notes and you’d like your users to share these media using WhatsApp, you can use the Document Interaction API to send your media to your WhatsApp contacts and groups.

WhatsApp Messenger can handle various types of media:

images of any type that conforms to public.image (for example, PNG and JPEG)
videos of any type that conforms to public.movie (for example, MPEG-4 video)
audio files (only MPEG-3, MPEG-4, AIFF, AIFF-C and Core Audio)

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 the 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

When triggered, WhatsApp will immediately present the user with the contact/group picker screen. The media will be automatically sent to a selected contact/group.

See the Apple documentation articles: Previewing and Opening Files and the UIDocumentInteractionController Class Reference for more information.

For more details plz check this link:- http://www.whatsapp.com/faq/en/iphone/23559013

Sample code for sharing video:-

self.documentationInteractionController.UTI = @"net.whatsapp.movie";
self.documentationInteractionController = [UIDocumentInteractionController interactionControllerWithURL: fileURL];
self.documentationInteractionController.delegate = self;
[self.documentationInteractionController presentOpenInMenuFromRect:CGRectZero inView:self.view animated:YES];
Ahmad Adibzad
  • 501
  • 2
  • 6
  • 14
Sri
  • 827
  • 8
  • 34
-1

WhatsApp has no developer API. This means you can not do the "share a video on whatsApp" action triggered by an external program. The integration that you can go to your gallery and say "share on whatsapp" is a plugin by WhatsApp itself, I don't see them exposing any API any tine soon to achieve what you want to achieve.

Edit : As Popeye mention - I was wrong

Segers-Ian
  • 1,027
  • 10
  • 21
  • This isn't true have a read of the documentation http://www.whatsapp.com/faq/en/iphone/23559013 they provide URL Schemes that allow you to share videos with ease. – Popeye Oct 22 '14 at 08:24
  • my bad, I was reading on whatsapp.com through the general faq if any API was available. I couldn't find it, but I should have had looked in the platform specific FAQ. But I was rather looking for "if they have an API" than how to "Solve this issue for iOS" – Segers-Ian Oct 22 '14 at 08:25