I have googled, and get some solutions, it seems the only possible way is thru UIDocumentInteractionController
. I have found the result that able to share
Please check below project on github
https://github.com/salesawagner/SharingWhatsApp
typedef enum{
kSendText = 0,
kSendImage,
kSendTextWithImage,
kSendAudio,
kSendCancel
} options;
- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex{
switch (buttonIndex) {
case kSendText:
[[WASWhatsAppUtil getInstance] sendText:@"Text"];
break;
case kSendImage:
[[WASWhatsAppUtil getInstance] sendImage:[UIImage imageNamed:@"image.jpg"] inView:self.view];
break;
case kSendTextWithImage:
NSLog(@"Send text with image");
case kSendAudio:
[[WASWhatsAppUtil getInstance] sendAudioinView:self.view];
break;
default:
NSLog(@"Cancel send");
break;
}
}