Closed Nameless77 closed 3 years ago
You can call Resources.Load<Texture2D>(texture path)
and pass the returned Texture2D to AddFile.
hello sir i am unable to share predefined image. as you mentioned i wrote some code here it is: `public void Click_Share() { StartCoroutine(TakeScreenShotAndShare()); } IEnumerator TakeScreenShotAndShare() { yield return new WaitForEndOfFrame();
string filePath = Resources.Load<Texture2D>("Promo").ToString();
new NativeShare().AddFile(filePath).SetSubject("Look at my Image").SetText("Hello world!")
.SetUrl("https://play.google.com/store/apps/details?id=com.microsoft.sudoku").Share();
// print(filePath);
}`
and this is the image which i want to share from resource folder : and on my android phone when i click on share button image was not loaded only text and url appear. so can you please suggest me something it will be a great help.
Texture2D image = Resources.Load<Texture2D>("Promo");
new NativeShare().AddFile(image).
Thank you sir this time it's working I thought that the file path should be string.
On Mon, May 3, 2021, 1:48 PM Süleyman Yasir KULA @.***> wrote:
Texture2D image = Resources.Load
("Promo");new NativeShare().AddFile(image). — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/yasirkula/UnityNativeShare/issues/110#issuecomment-831103337, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMXDTTP53JYAHZCGII7KAWLTLZL5JANCNFSM437ODI4Q .
AddFile can take either a file path or a Texture2D (for convenience).
Hello i am currently working on a sudoku game and want to publish it on play store.in this game i have added a sharing functionality(ex. when user press button a native share dialogue popped up and then when user click a perticular app to share then my game image automatically apper in that app(for example of whats app the image is automatically set))so how can i do this with native plugin.i already tried with resource folder(i put my image in resource folder but i cant get any image from resource folder).so can you please tell how to so this.