Skip to content
This repository has been archived by the owner on May 15, 2024. It is now read-only.

Data Transfer: Share Image with Title and URL #424

Closed
jrahma opened this issue Jul 28, 2018 · 3 comments
Closed

Data Transfer: Share Image with Title and URL #424

jrahma opened this issue Jul 28, 2018 · 3 comments
Labels
duplicate This issue or pull request already exists

Comments

@jrahma
Copy link

jrahma commented Jul 28, 2018

Hi,

Please add an option to Share Image with a Title and URL..

Thanks,
Jassim

@mattleibow
Copy link
Contributor

This probably is going to be related to #425 #416

@Redth
Copy link
Member

Redth commented Nov 26, 2018

Duplicate of #425

@Redth Redth marked this as a duplicate of #425 Nov 26, 2018
@Redth Redth closed this as completed Nov 26, 2018
@Redth Redth added the duplicate This issue or pull request already exists label Nov 26, 2018
@abdul-wasey
Copy link

You can achieve this functionality by writing some platform specific code .
I write a function that takes uri, message and bytes[] of image as arguments.
Here is the sample code for android.

public async Task Share(string uri, string message, byte[] bytes)
        {
            var intent = new Intent(Intent.ActionSend);
            intent.PutExtra(Intent.ExtraOriginatingUri, uri);
            intent.PutExtra(Intent.ExtraText, message);
            intent.SetType("image/png");

            var path = Android.OS.Environment.GetExternalStoragePublicDirectory(Android.OS.Environment.DirectoryDownloads
                + Java.IO.File.Separator + "logo.png");

            await File.WriteAllBytesAsync(path.AbsolutePath, bytes);
            intent.PutExtra(Intent.ExtraStream, Android.Net.Uri.FromFile(path));
            Forms.Context.StartActivity(Intent.CreateChooser(intent, "Here you go ;)"));
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

4 participants