Add Stickers & Links

Learn how to add Stickers and Attachment Links

Stickers can be added to give extra information to share media. These can be mascots of your game, game title with your own custom font, etc.

Stickers can be added on top of image or video that is being shared.

Create Sticker Instance

Sticker sticker = new Sticker("PATH_TO_STICKER_IMAGE");

Image passed can be of JPG or PNG format.

Add Sticker to Story Content

StoryContent content = new StoryContent("PATH_TO_IMAGE_FILE", false);
// StoryContent content = new StoryContent("PATH_TO_VIDEO_FILE", true);

content.SetSticker(sticker);// Pass sticker instance created above

Adding link to the sharing content lets users go to the target link along with the sharing content.

Adding links feature to sharing content needs an approval from Instagram Team. More Info here.

StoryContent content = new StoryContent("PATH_TO_IMAGE_FILE", false);
// StoryContent content = new StoryContent("PATH_TO_VIDEO_FILE", true);

content.SetAttachmentUrl("https://www.google.com");// Pass valid web url

Example

using VoxelBusters.InstagramKit;

private void Share(string contentFilePath, bool isVideoContent, string stickerPath, string attachmentUrl)
{
    StoryContent content = new StoryContent(contentFilePath, isVideoContent);

    // Create Sticker Instance
    Sticker sticker = new Sticker(stickerPath);
    
    // Set Sticker to the sharing content
    content.SetSticker(sticker);
    
    // Set Attachment Url
    content.SetAttachmentUrl(attachmentUrl);
            
    // Share the Content
    InstagramKitManager.Share(content, OnShareComplete);
}

private void OnShareComplete(bool success, string error)
{
	string message  =  success ? "Successfully Shared" : "Failed to share " + error;
	Debug.Log(message);
}

Last updated