Skip to content
This repository was archived by the owner on Dec 31, 2025. It is now read-only.
This repository was archived by the owner on Dec 31, 2025. It is now read-only.

Image is not getting shared when shared with Text on some platforms  #168

@harishG2W

Description

@harishG2W

@yasirkula Hi Thanks for the great plugin.
I am sharing the image like following but not able to see the image and text together in some selected apps

RenderTexture rt = new RenderTexture(resWidth, resHeight, 24);
Camera.main.targetTexture = rt;
Texture2D screenShot = new Texture2D(resWidth, resHeight, TextureFormat.RGB24, false);
Camera.main.Render();
RenderTexture.active = rt;
screenShot.ReadPixels(new Rect(0, 0, resWidth, resHeight), 0, 0);
Camera.main.targetTexture = null;
RenderTexture.active = null; // JC: added to avoid errors
Destroy(rt);
byte[] bytes = screenShot.EncodeToPNG();
string filename = G2WGameConstants.ScreenShotName(resWidth, resHeight);
isSharing =true;
new NativeShare().AddFile(filename)
.SetSubject("Subject").SetText("Sharing text")
.SetCallback((result, shareTarget) => isSharing = false
)
.Share();

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions