Share text and media with the WhatApp extension

I use UIActivityViewController so that the user can share photos and videos created in my application. I attached two UIActivityItemProviders to it: one for the medium and one for the default text ("Created with ...").

This works well for all the extensions I tested, except for WhatsApp. WhatsApp shows only the text in the message dialog box - no photo or video. However, when I leave the text blank, it will show the media file.

Is there a way to share a photo or video with the default text / title via WhatsApp?

+6
source share
1 answer

I faced the same problem. I implemented my own extension using https://github.com/sascha/SSCWhatsAppActivity . The downside is that when shared, you get two WhatsApp entries. WhatsApp is your own, and custom. I tried to exclude my own WhatsApp extension using UIActivityViewController.excludedActivityTypes with the active type net.whatsapp.WhatsApp.ShareExtension , but since iOS 8.1 this is no longer possible (intentionally or an error). More on this here: http://johnszumski.com/blog/excluding-third-party-apps-from-ios-8-share-sheet

In my conclusion, there is no way to provide both text and media for WhatApp's own extension. I decided to keep my usual WhatsApp access extension and name it β€œWhatsApp (+ Image)” so that the user can distinguish between the two.

+2
source

Source: https://habr.com/ru/post/987558/


All Articles