Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Share Plugin - Local Image Sharing Problem with WhatsApp #196

Closed
dhwalin opened this issue Jan 20, 2021 · 12 comments · Fixed by #816
Closed

Share Plugin - Local Image Sharing Problem with WhatsApp #196

dhwalin opened this issue Jan 20, 2021 · 12 comments · Fixed by #816

Comments

@dhwalin
Copy link

dhwalin commented Jan 20, 2021

Once again I am writing this problem. The thing is Sharing on Email is working. But when you try to share on WhatsApp, it says "can't send empty message", if you pass some text, only text is getting pasted in WhatsApp Chat window.

const save_image_id = random_id;
const dataURL = dataURLValue;

      Filesystem.writeFile({
        path: save_image_id+".jpg",
        data: dataURL,
        directory: FilesystemDirectory.Cache,
      }).then(function(result){

          Share.share({
            title:'Share',
            text:'',
            url:result.uri,
            dialogTitle:'Share'
          });

As per above code, first I am saving image in cache folder, get the path, pass the image file path with no text.

Sharesheet is getting open, on selection on WhatsApp, its get back into App by saying "Can't send empty message"

Now when you try with email, Image is getting attached.

So I guess there is no problem in my code. If anything is there, please let me know.

Testing Device:
One UI Core : 2.5
Android Version: 10

  • I have not tested with Instagram personally, but my tester said same thing is happen in instagram too.
@jcesarmobile jcesarmobile transferred this issue from ionic-team/capacitor Jan 20, 2021
@jcesarmobile jcesarmobile reopened this Jan 20, 2021
@jcesarmobile
Copy link
Member

plugins are now in this repository

@dhwalin
Copy link
Author

dhwalin commented Jan 21, 2021

May I know do I need to use from plugin itself or install @capacitor/share & use?

@jcesarmobile
Copy link
Member

This plugins are going to be for Capacitor 3, which is in beta state at the moment, so I wouldn't recommend using them until Capacitor 3 is final.

@dhwalin
Copy link
Author

dhwalin commented Jan 21, 2021

Is there any suggestion to use Share feature in App? Any package?

@imhoffd
Copy link
Contributor

imhoffd commented Jan 21, 2021

@dhwalin We aren't adding any new features to Capacitor 2 at this time. This issue tracks the request for Capacitor 3+.

@dhwalin
Copy link
Author

dhwalin commented Jan 22, 2021

But is there any possibility to solve the issue mentioned above? "Can't send empty message"

@nik736
Copy link

nik736 commented Apr 18, 2021

I have the same issue, is there any solution for that yet? :)

@marcelonnunes
Copy link

I have the same problem. To share images or files on Android by Whatsapp the error occurs. Sharing with other apps such as email or Hangouts works normally.

On IOS/Iphone sharing works well with Whatsapp and other apps.

My current solution was to use the Share plugin "https://capacitorjs.com/docs/apis/share#shareresult" for IOS/Iphone and another plugin for Android "https://ionicframework.com/docs/native/social- sharing" as the latter does not work on IOS either.

@notflip
Copy link

notflip commented Jan 31, 2022

Does anyone know if there is an update for this issue?

@sp-cmingay
Copy link

I too am interested in knowing whether there is a solution for this, I'm trying to share images (have tried either a local file uri or a base64 encoded string and while the native share interface (on android) shows the image preview when I try to share with Whatsapp I get "File format not supported" and when I attempt to share via any of the Instagram methods it just opens Instagram and no share function is started.

I am attempting to run a Svelte app through Capacitor and am not using Ionic, I'd be surprised if this was an issue, but just putting it out there.

As a comparison I am having no problems sharing an image via similar means in an Expo app (using the expo-sharing plugin) however in an ideal world I'd use Capacitor with Svelte!

@sp-cmingay
Copy link

sp-cmingay commented Feb 25, 2022

Sorry just to follow on the fix presented by @MitchMakesThings here works for me with both Whatsapp and Instagram (so thank you Mitch!)

@ionitron-bot
Copy link

ionitron-bot bot commented Sep 30, 2022

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of the plugin, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Sep 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants