OpenFlutter / flutter_share_me

Flutter Plugin for sharing contents to social media. You can use it share to Facebook , WhatsApp , Twitter And System Share UI. Support Url and Text.
https://github.com/lizhuoyuan
Apache License 2.0
160 stars 159 forks source link

Added complete support for iOS. #43

Closed jigarfumakiya closed 3 years ago

jigarfumakiya commented 3 years ago

Hello @lizhuoyuan

This is PR suggest below changes.

  1. Added support for Twitter.
  2. Added support for Facebook.
  3. Fixed bugs in Whatsapp.
  4. Upgrade example to null safety.
  5. Updated readme

Can you please take look at all the changes and let me know if require any changes or you want to discuss anything.

Note-:Some might be breaking changes.

Let me know Jigar

jigarfumakiya commented 3 years ago

Hey @lizhuoyuan Did you release this version on pub or not?

Also, I have some plans for this plugin for adding multiple new features. I like to be a co-contributor of the packages.

Let me know what you think. Thanks

lizhuoyuan commented 3 years ago

@jigarfumakiya Thank you for your contribution, I would love to have someone willing to work hard for this, which will help many people. I am going to release it after the test is correct, and tomorrow at the latest.

jigarfumakiya commented 3 years ago

Perfect @lizhuoyuan

lizhuoyuan commented 3 years ago

Hey, bro. I have a question about sharing pictures on whatsapp.

/// @parm imageUrl is local image
  Future<String?> shareToWhatsApp({String msg = '', String imageUrl = ''}) 

The parameter here refers to the local path, or the image URL, or byte, base64?

jigarfumakiya commented 3 years ago

This refers to the local image URL. As of now, we don't have support base64. Will add it soon.

lizhuoyuan commented 3 years ago

So it is a path to a local image,right?

jigarfumakiya commented 3 years ago

Yes, It's a path to a local image.

lizhuoyuan commented 3 years ago

When I want to share pictures to whatsapp, it always fails and returns false. I saved a picture from elsewhere to the phone, the following is the path: /var/mobile/Containers/Data/Application/3C79084F-F2C6-410C-9D1A-FD894122DE45/Documents/deer_test_share_2021-08-12 16:18:31.930366.png

jigarfumakiya commented 3 years ago

@lizhuoyuan Will debug it later today. Can you please send me which device and model? Thanks

lizhuoyuan commented 3 years ago

iphone X os version: 14.4.2

jigarfumakiya commented 3 years ago

Thanks Let me know if you find any other issues

jigarfumakiya commented 3 years ago

Hey @lizhuoyuan I have done some debugging. I am able to go to WhatsApp share but there is some issue going on maybe on WhatsApp that says This item can not be shared

Here is the image

IMG_3ACD512C01B1-1

But Plugin successfully sending users to WhatsApp App.I am not able to reproduce the issue as suggested

Let me know what is error you get.

armandojimenez commented 3 years ago

This did not work for me, it does not share directly to whatsapp, it creates a temp file and open the native bottom sheet

jigarfumakiya commented 3 years ago

Yes, it's correct because WhatsApp doesn't allow direct picture sharing in IOS due to security reasons. You can read more if you want here-:https://faq.whatsapp.com/iphone/how-to-link-to-whatsapp-from-a-different-app/?lang=en

lizhuoyuan commented 3 years ago

@jigarfumakiya I have added permissions to you, can you see if you can modify the code directly

jigarfumakiya commented 3 years ago

@lizhuoyuan we can do nothing here. As @armandojimenez said it crate the temp file and opens the bottom sheet so the plugin working as expected. As I said before Whats doesn't allow direct sharing you read more on their official doc.