Hi,
I am trying to download an external image to the phone from the internet then upload the image to Facebook on a button click in Xamarin. This is a sharing text solution I found online which works well.
Interface:
public interface IShareable
{
void OpenShareIntent(string textToShare);
}
IOS Side:
public void OpenShareIntent(string textToShare)
{
var activityController = new UIActivityViewController(new NSObject[] { UIActivity.FromObject(textToShare) }, null);
UIApplication.SharedApplication.KeyWindow.RootViewController.PresentViewController(activityController, true, null);
}
Android Side:
public void OpenShareIntent (string textToShare)
{
var myIntent = new Intent(Android.Content.Intent.ActionSend);
myIntent.SetType("text/plain");
myIntent.PutExtra(Intent.ExtraText, textToShare);
Forms.Context.StartActivity(Intent.CreateChooser(myIntent,"Choose an App"));
}
But what I want to do is give it a string with a website url to an image and it will download the image to the device then share it.
Any help would be great.
Thanks in advance.