Forum Xamarin Xamarin.Android

Send Audio and Image to Social Media

I trying to share audio and image at the same time to any Social media. Seems like I only can share either audio or images at once time. I wondering is it possible to send both at once?

`public async void SharePlayScreenResult()
   // images for sharing
   var screenshotpath = Android.OS.Environment.GetExternalStoragePublicDirectory("Pictures").AbsolutePath + Java.IO.File.Separator + "screenshot.png";
   var imageURI = Android.Net.Uri.Parse($"file://{screenshotpath}");

   // audio for sharing 
   var path = Android.OS.Environment.ExternalStorageDirectory.AbsolutePath;
   var documentsPath = System.IO.Path.Combine(path, "user_audio.wav");
   var audioPath = Android.Net.Uri.Parse($"file://{documentsPath}");

   Intent intent = new Intent(Intent.ActionSend);
   intent.PutExtra(Intent.ExtraStream, imageURI);

   intent.PutExtra(Intent.ExtraStream, audioPath);

   // intent.SetType("image/png");
   // intent.SetType("audio/wav");
   Forms.Context.StartActivity(Intent.CreateChooser(intent, "Share"));
Sign In or Register to comment.