Android Native share (intent) an image with a link

Hi, I’m trying to share via the android native sharing service a screenshot + a link to my application.
The screenshot part is working perfectly though i don’t see the text (tried to share with Facebook, twitter and whatsapp).

Here is my code (mostly taken from here):

public IEnumerator ShareScreenshot(string extraSubject, string extraText)
{
    isProcessing = true;
    // wait for graphics to render
    yield return new WaitForEndOfFrame();
    
    // create the texture
    var width = Screen.width;
    var height = Screen.height;
    var tex = new Texture2D(width, height, TextureFormat.RGB24, false);
    // Read screen contents into the texture
    tex.ReadPixels(new Rect(0, 0, width, height), 0, 0);
    tex.Apply();
   
    byte[] dataToSave = tex.EncodeToPNG();
    string destination = Path.Combine(Application.persistentDataPath, System.DateTime.Now.ToString("yyyy-MM-dd-HHmmss") + ".png");
    File.WriteAllBytes(destination, dataToSave);
    if (!Application.isEditor)
    {
        // block to open the file and share it ------------START
        AndroidJavaClass intentClass = new AndroidJavaClass("android.content.Intent");
        AndroidJavaObject intentObject = new AndroidJavaObject("android.content.Intent");
        intentObject.Call<AndroidJavaObject>("setAction", intentClass.GetStatic<string>("ACTION_SEND"));
        AndroidJavaClass uriClass = new AndroidJavaClass("android.net.Uri");
        AndroidJavaObject uriObject = uriClass.CallStatic<AndroidJavaObject>("parse", "file://" + destination);
        intentObject.Call<AndroidJavaObject>("putExtra", intentClass.GetStatic<string>("EXTRA_STREAM"), uriObject);

        intentObject.Call<AndroidJavaObject>("setType", "text/plain");

        //add data to be passed to the other activity i.e., the data to be sent
        intentObject.Call<AndroidJavaObject>("putExtra", intentClass.GetStatic<string>("EXTRA_SUBJECT"), extraSubject);
        intentObject.Call<AndroidJavaObject>("putExtra", intentClass.GetStatic<string>("EXTRA_TEXT"), extraText);

        intentObject.Call<AndroidJavaObject>("setType", "image/jpeg");
        AndroidJavaClass unity = new AndroidJavaClass("com.unity3d.player.UnityPlayer");

        AndroidJavaObject jChooser = intentClass.CallStatic<AndroidJavaObject>("createChooser", intentObject, "Share Via");
        AndroidJavaObject currentActivity = unity.GetStatic<AndroidJavaObject>("currentActivity");
        currentActivity.Call("startActivity", jChooser);
    }

    isProcessing = false;
    buttonShare.enabled = true;
    ButtonRestart.enabled = true;
}

I have a blog post about what you need http://alihc.me/unity-3d-native-nativeshare/

Hi , I have followed this code for snapshot sharing. It works fine except 7.0 devices. The intent chooser option window doesn’t open in 7.0 and above devices. Can anybody guide me how to resolve this? Thanks in advance .

For those who didn’t find the answer try this code. It worked for me.

Get Source Code from

For reference go to

Please mention, if it works in Android Oreo or later.