Skip to content

Instagram

levching edited this page Apr 14, 2020 · 5 revisions

Sharing approach is the no different from sharing to another social media with Ultimate Mobile.

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

var client = UM_SocialService.SharingClient;
var builder = new UM_ShareDialogBuilder();

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

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

Please note, that you can use native sharing only if the application you want to share with is installed on a user device. There is no cross-platform API for detecting if the application is installed on the device since approaches of iOS and Android are very different. But both platforms provide the way to detect if the application is installed, check out the per-platform guides:

Clone this wiki locally