You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you create a PDF file, write it to storage using @capacitor/filesystem and then pass the URI (e.g. "file://" URI) of the newly created file to @capacitor/share, then it works with some apps (e.g. Gmail, Google Drive) and you get the file as an attachment.
However if you select a WhatsApp conversation, then it only shows the text, not the PDF file itself. This would not be useful in my use-case (the PDF is important but the text is not), and I think it would be confusing for users that they can share the PDF file to some apps but not others.
Example:
await Share.share({
title: 'See cool stuff',
text: 'Really awesome thing you need to see right meow',
url: result.uri, // a "file://..." uri
dialogTitle: 'Share with buddies',
});
Expected Behavior
I would have expected WhatsApp to receive the PDF file and display it in the conversation, just as Gmail receives the PDF and adds it as an email attachment.
At first I wasn't sure if this was just a limitation with WhatsApp itself but if I open up the PDF in the mobile Microsoft Office app and press the share button in there, it does successfully pass the file through to WhatsApp and it shows up in the conversation, so that suggests that WhatsApp is capable of receiving and displaying PDFs via an Android Intent or some other mechanism.
Running this on an Android device, pressing the button in the example app's home page and choosing a WhatsApp conversation, you only get the text ("Really awesome thing you need to see right meow") but not the attached PDF file.
Other Technical Details
I have only tested this on Android as I don't have an iPhone to test with right now so not sure if this is specific to the Android platform or if it also applies on iOS.
The text was updated successfully, but these errors were encountered:
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.
Bug Report
Plugin(s)
@capacitor/share v1.0.3
Capacitor Version
Platform(s)
Android (tested on version 10)
Current Behavior
If you create a PDF file, write it to storage using @capacitor/filesystem and then pass the URI (e.g. "file://" URI) of the newly created file to @capacitor/share, then it works with some apps (e.g. Gmail, Google Drive) and you get the file as an attachment.
However if you select a WhatsApp conversation, then it only shows the text, not the PDF file itself. This would not be useful in my use-case (the PDF is important but the text is not), and I think it would be confusing for users that they can share the PDF file to some apps but not others.
Example:
Expected Behavior
I would have expected WhatsApp to receive the PDF file and display it in the conversation, just as Gmail receives the PDF and adds it as an email attachment.
At first I wasn't sure if this was just a limitation with WhatsApp itself but if I open up the PDF in the mobile Microsoft Office app and press the share button in there, it does successfully pass the file through to WhatsApp and it shows up in the conversation, so that suggests that WhatsApp is capable of receiving and displaying PDFs via an Android Intent or some other mechanism.
Code Reproduction
I've created an example app to demonstrate the problem here: https://github.com/mattwilson1024/support-ticket-capacitor-share.
See src/app/home/home.page.ts to see how I wrote the file and tried to share it.
Running this on an Android device, pressing the button in the example app's home page and choosing a WhatsApp conversation, you only get the text ("Really awesome thing you need to see right meow") but not the attached PDF file.
Other Technical Details
I have only tested this on Android as I don't have an iPhone to test with right now so not sure if this is specific to the Android platform or if it also applies on iOS.
The text was updated successfully, but these errors were encountered: