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

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

Open
harishG2W opened this issue Apr 6, 2023 · 1 comment
Open
Labels

Comments

@harishG2W
Copy link

harishG2W commented Apr 6, 2023

@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();

@harishG2W harishG2W added the bug label Apr 6, 2023
@yasirkula
Copy link
Owner

That's unfortunately expected:

image

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants