How to share image along with text (both image and text) on same request using Xamarin essential

Moon 1 Reputation point
2023-02-01T13:28:35.8566667+00:00

I want to share image file along with text in my mobile application. I am using Xamarin essential. but with this either I am able to share image or text. how to share both on a single request?

Developer technologies | .NET | Xamarin
Developer technologies | XAML
Developer technologies | C#
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Reza Aghaei 4,986 Reputation points MVP
    2023-02-01T14:27:45.0533333+00:00

    The share feature allows sharing a text along with the file, for example:

    var fileName = Path.Combine(FileSystem.CacheDirectory, "Photo.jpeg");
    var title = "Title of the photo";
    await Share.RequestAsync(new ShareFileRequest
    {
        Title = title,
        File = new ShareFile(fileName)
    });
    
    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.