NicholasSheehan / Unity-Native-Sharing

A Unity plugin to open native sharing dialogs on iOS and Android, primarily for text and files
MIT License
445 stars 119 forks source link

WhatsApp not sharing image #69

Open iantierney opened 3 years ago

iantierney commented 3 years ago

Anyone else having trouble with whatsApp only sharing text, not an image?

Unity-Native-Sharing 1.0.5 iOS 14 WhatsApp 2.21.41.2

NicholasSheehan commented 3 years ago

https://stackoverflow.com/a/55688479

Turns out that Whatsapp doesn't like it, I'm looking into their API now to see what's possible

iantierney commented 3 years ago

Thanks Nic, Thats interesting. Perhaps it could just share the image? Let me know what you find, I can test it. Ian

On 24 Apr 2021, at 19:14, Nicholas Sheehan @.***> wrote:

https://stackoverflow.com/a/55688479

Turns out that Whatsapp doesn't like it, I'm looking into their API now to see what's possible

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

NicholasSheehan commented 3 years ago

Done some more digging, it seems like the generic way of sharing doesn't allow both text and an image on WhatsApp

Even another Unity sharing plugin has the same issue

iantierney commented 3 years ago

Interesting, can we share, just the image? Ian

On 8 May 2021, at 02:32, Nicholas Sheehan @.***> wrote:

Done some more digging, it seems like the generic way of sharing doesn't allow both text and an image on WhatsApp

• https://stackoverflow.com/questions/39977066/share-text-and-image-on-whatsapp-using-uiactivityviewcontroller
• mwaterfall/MWPhotoBrowser#528

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

NicholasSheehan commented 3 years ago

Yeah, if you don't pass any text then it's not added to the list of items to share, so the only thing in that list should be the image path

Ref: https://github.com/NicholasSheehan/Unity-Native-Sharing/blob/aae5e81164579db50046faaaa9a4d5bf489dc91b/Plugins/iOS/UnityNative_Sharing.mm#L28

NicholasSheehan commented 3 years ago

Also i have a small amount off free time now and I've starting doing some maintenance now

iantierney commented 3 years ago

Thanks Nic, Is there a way to detect the user has selected WhatsApp share? Also, will I just hang-on while you do you maintenance before branching the code?

Ian

On 8 May 2021, at 17:51, Nicholas Sheehan @.***> wrote:

Also i have a small amount off free time now and I've starting doing some maintenance now

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

NicholasSheehan commented 3 years ago

I found a way to detect what app was shared to, but only after the share has completed, can't find anything about detecting what app was selected before the share is completed

HarryJBushell commented 2 years ago

Hey! Confusing development here - the Android version of WhatsApp allows sharing of text & images, seems like this is an iOS exclusive problem. Any idea why that is - or any update on this bug in general?

NicholasSheehan commented 2 years ago

If there is an issue its with WhatsApp itself, all this library does is signal to iOS that it wants to share an image with some text, then iOS will gather a list of apps that can share text and images and pass on the information to the app the user selects. If WhatsApp isn't displaying the image then its most likely WhatsApp not respecting the image path.Facebook has a similar issue where it wont use the text sent to it, and only share the image. So this behaviour with WhatsApp doesn't surprise meOn 18 May 2022 15:54, HarryJBushell @.***> wrote: Hey! Confusing development here - the Android version of WhatsApp allows sharing of text & images, seems like this is an iOS exclusive problem. Any idea why that is - or any update on this bug in general?

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>

HarryJBushell commented 2 years ago

Yeah, I had a similar issue of Facebook and Instagram not sharing text, but it was a policy issue on their behalf. Hoped WhatsApp might be different bc the Android version doesn't have this issue. Ah well, thanks anyway!

HarryJBushell commented 2 years ago

Hey again @NicholasSheehan ! Is there a way we could somehow prioritise the image over the text, so that when we hit 'share', systems like whatsapp iOS (which only share one of the two) will prioritise images?

Failing that, how could I go about editing the plugin to only share images? I'm trying to dig around in the code and remove the bits which generate & send text, but I could use some guidance :)