Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Share text AND media with WhatApp Share Extension

I'm using a UIActivityViewController to enable the user to share photos and videos created with my app. I attached two UIActivityItemProviders to it: one for the media and one for a default text to use ("Created with...").

This works well for all share extensions I tested—except for WhatsApp. WhatsApp only shows the text in the message dialog—no photo or video. When I leave the text blank, however, it will show the media file.

Is there any way I can share a photo or video with a default text/caption via WhatsApp?

like image 380
Frank Schlegel Avatar asked May 20 '15 07:05

Frank Schlegel


1 Answers

I'm facing the same challenge. I implemented my own extension using https://github.com/sascha/SSCWhatsAppActivity. The downside is that you'll get two WhatsApp entries when sharing. WhatsApp's own one, and the custom one. I tried excluding WhatsApp's own extension using UIActivityViewController.excludedActivityTypes with the activityType net.whatsapp.WhatsApp.ShareExtension but since iOS 8.1 this is not possible anymore (on purpose or a bug). More on that here: http://johnszumski.com/blog/excluding-third-party-apps-from-ios-8-share-sheet

My conclusion, there is no way to provide both text + media to WhatApp own sharing extension. I decided to keep my custom WhatsApp sharing extension and name it "WhatsApp (+Image)" so the user can distinguish the two.

like image 96
matty Avatar answered Sep 22 '22 23:09

matty