Cross Platform Instagram Kit
  • Introduction
  • Usage
    • Namespace
  • Api
    • Is Service Available
    • Image Sharing
    • Video Sharing
    • Add Stickers & Links
  • Utility Snippets
    • Save Texture2D to Persistent Path
    • Save Video to Persistent Path
Powered by GitBook
On this page
  • Create Sticker Instance
  • Add Sticker to Story Content
  • Add Attachment Link
  • Example

Was this helpful?

  1. Api

Add Stickers & Links

Learn how to add Stickers and Attachment Links

PreviousVideo SharingNextSave Texture2D to Persistent Path

Last updated 6 years ago

Was this helpful?

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

Add Attachment Link

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.

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);
}
More Info here.