Share Sheet
Share sheet allows you to share your content to any app in general. What ever apps that support to share your content will be shown to the user and user can select the service he/she wants to share on.

Share text

1
ShareSheet shareSheet = ShareSheet.CreateInstance();
2
shareSheet.AddText("Text");
3
shareSheet.SetCompletionCallback((result, error) => {
4
Debug.Log("Share Sheet was closed. Result code: " + result.ResultCode);
5
});
6
shareSheet.Show();
Copied!

Share text with screenshot

1
ShareSheet shareSheet = ShareSheet.CreateInstance();
2
shareSheet.AddText("Text");
3
shareSheet.AddScreenshot();
4
shareSheet.SetCompletionCallback((result, error) => {
5
Debug.Log("Share Sheet was closed. Result code: " + result.ResultCode);
6
});
7
shareSheet.Show();
Copied!

Share screenshot

1
ShareSheet shareSheet = ShareSheet.CreateInstance();
2
shareSheet.AddScreenshot();
3
shareSheet.SetCompletionCallback((result, error) => {
4
Debug.Log("Share Sheet was closed. Result code: " + result.ResultCode);
5
});
6
shareSheet.Show();
Copied!

Share image

1
Texture2D texture = Resources.Load<Texture2D>("texture name");
2
3
ShareSheet shareSheet = ShareSheet.CreateInstance();
4
shareSheet.AddImage(texture);
5
shareSheet.SetCompletionCallback((result, error) => {
6
Debug.Log("Share Sheet was closed. Result code: " + result.ResultCode);
7
});
8
shareSheet.Show();
Copied!

Share URL with text

1
ShareSheet shareSheet = ShareSheet.CreateInstance();
2
shareSheet.AddText("Text");
3
shareSheet.AddURL(URLString.URLWithPath("https://www.google.com"));
4
shareSheet.SetCompletionCallback((result, error) => {
5
Debug.Log("Share Sheet was closed. Result code: " + result.ResultCode);
6
});
7
shareSheet.Show();
Copied!
Last modified 10mo ago