Send Whatsapp Message With Image

I am wanting to create a function on our app. When any user will click on APP SHAREING ICON then an image and pre written message will send to the WhatsApp number.

But on mobile a error is displayed after clicking on the APP SHAREING ICON.
I am uploading my codes and the error.

Please tell me how it will can fix?

Where is the file you want share?

In the app I have added a SHARE icon button. If anyone will click on the share icon button, then an image and a pre written text will be sent to the WhatsApp number.
But a error is here.

Just be patient instead of spamming the community.

Hello user.

The Sharing component is a bit odd, and only supports absolute paths, e.g. /storage/emulated/0/Android/data/packagename/image.png. You cannot feed the Sharing component with an asset directly because it is in the simplest form (e.g. image.png). However, what you can do is to copy the image to the ASD, and then getting the absolute path. Add a File component from the Storage drawer to satisfy this need.

Also, the Sharing component does not directly send a message to WhatsApp. It prompts a dialog allowing users to share the file and the message to multiple apps. You can consider using this extension and sending the file directly via WhatsApp: WhatsAppTools Extension [Free & Open Source].

I have an image named frohe-weihnachten.jpeg in my Media, and displayed in an image. In case if you insist using the built-in component, I have included both methods.

WhatsApp.aia (28.3 KB)

Also, do not spam a thread with the same replies. It is very inconsiderate and does not keep the community clean. This will discourage people from helping you, and may result in your topic going further down in the list. Patiently wait for users to read your topic and give you a response.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.