yasirkula / UnityNativeShare

A Unity plugin to natively share files (images, videos, documents, etc.) and/or plain text on Android & iOS
MIT License
891 stars 131 forks source link

Sharing GIF on iOS #22

Open hippogamesunity opened 5 years ago

hippogamesunity commented 5 years ago

Hi! As you said me in email, "I was able to share gifs with only half of the apps in the share sheet". That's why you decided to share static images on iOS. Maybe you could add a parameter or a overriding call to unlock the feature for sharing GIFs on iOS? Having such feature would be very useful for me even if I could share it with not all apps from a list. Thanks!

yasirkula commented 5 years ago

Thanks for opening this issue. I'll add a link to it as a workaround for this issue in README.

To support animated gif files on iOS, simply remove these 4 lines from NativeShare.mm: https://github.com/yasirkula/UnityNativeShare/blob/ae2e13d17e477f6a93016897b4fa326146fa4e1e/Plugins/NativeShare/iOS/NativeShare.mm#L20-L23

I don't want to add a parameter for this because after this change, some apps just stop accepting the gif file as an attachment. They won't even accept it as a static image whereas at its current state, they do accept gif files as static image attachments. So, I'd prefer this solution to be a "use at your own risk" workaround rather than an official part of the plugin.

hippogamesunity commented 5 years ago

Cool, thanks! I'll check it!

hippogamesunity commented 5 years ago

I was able to test the new build of Pixel Studio. I was not able to reproduce your issue. Can you provide the reproduction steps to the issue you are talking about? I can share GIF with Gmail and also save it to iOS Photos with Share dialog. In both cases I get animated GIF. If I share it to Facebook, it becomes a static image on my wall.

yasirkula commented 5 years ago

It didn't work for some of these apps: Twitter, Facebook Messenger and/or the mail app. I can't remember which one(s) exactly :/

hippogamesunity commented 5 years ago

Yes, it doesn't work with Messenger as I suppose it doesn't support GIF. But it works wit Facebook, but Facebook will contert it to static image. Didn't try Twitter yet.

Rajat-Parihar commented 5 years ago

hello , sorry for my noob question but

UnityNativeShare/Plugins/NativeShare/iOS/NativeShare.mm i dint find that in my project

hippogamesunity commented 5 years ago

@Rajat-Parihar why no to use search?) Assets\GifAssets\NativeShare\Plugins\iOS\NativeShare.mm

PS. This question relates to my asset GIF Replay.

yasirkula commented 5 years ago

NativeShare.mm is located at Assets/Plugins/NativeShare/iOS/NativeShare.mm, if you import NativeShare.unitypackage to your project.

Rajat-Parihar commented 5 years ago

Thanks for your support guys, I remove those 4 lines for NativeShare.mm file but still can not share gif file through whats app

yosun commented 5 years ago

Hi! Can you explain more about the issue of gif share only as static images? Is this due to the format that NativeGallery writes it in?

yasirkula commented 5 years ago

While trying to share an animated gif file, as far as I remember, sharing on Facebook and/or Twitter didn't work for me. But using a UIImage to share the gif as a static image did work for those social platforms. So I used UIImage for maximum compatibility in NativeShare.

magnitocorp commented 5 years ago

Hi Yasirkula, Thanks for sharing your plugin. I just wondering, is there a way I can get a callback if the sharing was successful? so I can give a reward if the users really shared the content. Thanks.

yasirkula commented 5 years ago

@magnitocorp Please see https://github.com/yasirkula/UnityNativeShare/issues/5

MuhammadGhilman commented 3 years ago

Hi, I hope you are fine. first of all thanks for sharing a very good work. I am using this. but I faced a problem. As I can share images on very media. but it is not same with text. I can share text(URL) on WhatsApp, SMS, MMS, Gmail, Twitter(Direct message) and on yahoo mail. But can not share on Facebook Messenger, Instagram message, Skype, and Viber. i have read about Facebook in you documentation. Instagram may have save explanation like FB Messenger. but there is a need of description about Skype sharing. Kindly guide me. i need your help.

I will be waiting for your response.

yasirkula commented 3 years ago

Is the image shared successfully after removing the text(URL)?

MuhammadGhilman commented 3 years ago

yes we can share image. with text and URL. there is no problem with image sharing. problem with the text and URL sharing. we can only share image on Facebook messenger, Instagram Message, Skye an Viber but not with text and URL. I am giving image, Text and URL, as you give the code on git. But and the end receiver only receives image but not text and URL. I want to share Text and URL. image is not important for me right now.

yasirkula commented 3 years ago

Since images aren't as important as the text, does removing all AddFile calls not work?

MuhammadGhilman commented 2 years ago

Yes with out picture I can share text and URLs. its woring fine. with picture is can not send.

MuhammadGhilman commented 2 years ago

There is an othere problem. When i am tring to share Text and URL (working with every media on android), its not working with skype on iOS. 104 error is being displaye, when i try to share with skype on iOS. can you guide me. image is attached bellow.

IMG_06221

yasirkula commented 2 years ago

Please create a new Issue if it isn't related to this issue (Sharing GIF on iOS9) the next time. Does logging out of Skype and then logging back in help? For testing purposes, does omitting url or text help? How about appending url to text?