Native Sharing

One of the great things about Android applications is their ability to communicate and integrate with each other. Why reinvent functionality that isn't cored to your application when it already exists in another application?

When you want to share some data like text, URL, image, or everything at once, without specifying the social network/application you sharing too, you may use the sharing dialog. All you need to do is to configure the UM_ShareDialogBuilder and use SystemSharingDialog method to share a built dialog. See the code sample below:

using SA.Foundation.Utility;
using SA.CrossPlatform.Social;
...

var client = UM_SocialService.SharingClient;
var builder = new UM_ShareDialogBuilder();
builder.SetText("Hello world!");
builder.SetUrl("https://stansassets.com/");

//Juts generating sample red texture with 32x32 resolution
Texture2D sampleRedTexture = SA_IconManager.GetIcon(Color.red, 32, 32);
builder.AddImage(sampleRedTexture);

client.SystemSharingDialog(builder, (result) => {
    if(result.IsSucceeded) {
        Debug.Log("Sharing started ");
    } else {
        Debug.Log("Failed to share: " + result.Error.FullMessage);
    }
});

Or let's say you would like to share your application screenshot:

using SA.Foundation.Utility;
using SA.CrossPlatform.Social;
...

SA_ScreenUtil.TakeScreenshot(texture => 
{
    var client = UM_SocialService.SharingClient;
    var builder = new UM_ShareDialogBuilder();
    builder.SetText("Hello world!");
    builder.SetUrl("https://stansassets.com/");
    builder.AddImage(texture);

    client.SystemSharingDialog(builder, (result) => {
        if(result.IsSucceeded) {
            Debug.Log("Sharing started ");
        } else {
            Debug.Log("Failed to share: " + result.Error.FullMessage);
        }
    });
});

Feel free to explore the SA_ScreenUtil class, there is few more helper function you might be interested in.