Overview
Instagram Share Kit shares images and videos from your Unity game to Instagram on Android and iOS: to the feed (and Reels or messages, the player picks) and to Stories, with stickers and gradient backgrounds. One static C# class does it. There is no Instagram SDK to install, no login and nothing to add to your manifest, Gradle files or Info.plist.
The kit shares files you already have: a screenshot, a recording, a picture made by the player. It does not capture
screenshots or record video itself (Unity's ScreenCapture does the first; see
Share a screenshot).
Share in one line
Set your Facebook App ID once, then pass a file path: Instagram opens with your story.
Feed and Stories
Six calls: feed images and videos, and image, video, sticker and gradient Stories.
Zero setup
The plugin brings its own FileProvider, manifest query, androidx dependency and Info.plist entries.
Ready-to-run demo
Every share call on one screen, with a sample image, sticker and video.
Requirements
| Item | Version | Notes |
|---|---|---|
| Unity | 6000.0+ | Android and/or iOS build support installed |
com.unity.ugui | 2.0+ | The demo's UI only |
| Instagram app | current | Installed on the player's device. Without it, the share calls do nothing and IsInstagramInstalled() returns false. |
| Facebook App ID | From developers.facebook.com. Meta requires it for Stories; feed sharing works without it. |
Quick start
- Import the package The plugin lands in
Assets/hardartcore/Instagram Shareand the demo media inAssets/StreamingAssets/InstagramShare. - Set your App ID Once, before the first Story:
InstagramShareHelper.FacebookAppId = "1234567890"; - Save a file Write the image or video to
Application.persistentDataPathorApplication.temporaryCachePath. - Share it Call one of the share methods with the file's absolute path. Build to an Android or iOS device with Instagram installed.
using Hardartcore.InstagramShare;
using UnityEngine;
public class ShareButton : MonoBehaviour
{
private void Awake()
{
InstagramShareHelper.FacebookAppId = "1234567890";
}
public void Share()
{
var path = Application.persistentDataPath + "/score.png";
if (InstagramShareHelper.IsInstagramInstalled())
{
InstagramShareHelper.ShareImageAsInstagramStory(path);
}
}
}
Every call is a safe no-op in the Editor and on other platforms, and IsInstagramInstalled() returns false there. Test sharing on a device.
The demo
Open Demo/Scene/DemoScene. It copies the sample image.jpg, sticker.png and
video.mp4 out of StreamingAssets/InstagramShare into
Application.persistentDataPath (Instagram needs real files), shows the image and sticker in a story
preview, and has one button per share call. Set your Facebook App ID on the Demo object's
DemoScript before building. The status chip shows whether Instagram is installed; without it the
buttons are disabled on a device. The layout adapts to portrait and landscape.
Share a screenshot
public IEnumerator ShareScreenshot()
{
yield return new WaitForEndOfFrame();
var texture = ScreenCapture.CaptureScreenshotAsTexture();
var path = Path.Combine(Application.temporaryCachePath, "screenshot.png");
File.WriteAllBytes(path, texture.EncodeToPNG());
Destroy(texture);
InstagramShareHelper.ShareImageAsInstagramStory(path);
}
API reference
Everything is on the static class Hardartcore.InstagramShare.InstagramShareHelper. Paths are absolute
file paths. Colours are hex strings such as "#02937B".
- FacebookAppId
string. Your Facebook App ID. Meta requires it for Stories.- IsInstagramInstalled()
bool. True when Instagram is on the device. Share calls do nothing without it.- ShareImageToInstagram(path)
- An image (JPEG, PNG or GIF) to Instagram. Android: Instagram's share screen, where the player picks feed, Reels or a message. iOS: the system share sheet, where the player picks Instagram.
- ShareVideoToInstagram(path)
- A video (MP4 or MKV, 3 seconds to 10 minutes, at least 640×640), the same way.
- ShareImageAsInstagramStory(path, attributionLink = null)
- An image as the Story background.
- ShareVideoAsInstagramStory(path, attributionLink = null)
- A video as the Story background.
- ShareImageWithGradientAsInstagramStory(sticker, topColor, bottomColor, attributionLink = null)
- A sticker on a two-colour gradient. The same colour twice gives a solid background.
- ShareBackgroundImageAndStickerAsInstagramStory(image, sticker, attributionLink = null)
- An image background with a sticker on top, which the player can move and resize.
- SetFileProvider(suffix)
- Android Not needed: the plugin has its own provider. Use it only to share through a
FileProvideryou declared yourself, passing its authority suffix with a leading dot. - CopyFile(name)
- Android Copies
StreamingAssets/nameto the app-specific external files folder. The demo shows a cross-platform way withUnityWebRequest.
Android only, and Instagram only shows it for apps Meta has approved. iOS ignores it.
Media specs
Meta's recommendations for Stories, from its Sharing to Stories guide:
| Asset | Formats | Recommended |
|---|---|---|
| Story image | JPG, PNG | 9:16 |
| Story video | H.264, H.265, WebM | At least 720×1280, 9:16, up to 20 seconds |
| Sticker | JPG, PNG | 640×480, transparent PNG for a cut-out look |
How it works
Android
Story calls send Instagram's com.instagram.share.ADD_TO_STORY intent with your App ID as
source_application; feed calls send an ACTION_SEND intent to Instagram. File paths become
content:// URIs through the plugin's FileProvider, and Instagram is granted read access to
them. The Android library Plugins/Android/InstagramShare.androidlib adds to your build:
- FileProvider
com.hardartcore.instagram.InstagramFileProviderwith the authority<your application id>.hardartcore.instagram. Its own class name, so it never clashes with another plugin's or your ownFileProvider.- Shared folders
- External storage, the app's files folder and cache folder:
Application.persistentDataPathandApplication.temporaryCachePathwork whether they are external or internal. No storage permission is needed. - Queries
<queries><package android:name="com.instagram.android"/></queries>, so Android 11+ lets the app see Instagram.- Dependency
androidx.core:core:1.9.0in the library'sbuild.gradle, downloaded by Gradle from Google's Maven repository.- ProGuard
proguard-rules.prokeepscom.hardartcore.instagram.**, which C# calls by name, when you enable minification.
iOS
Story calls put your file data on the pasteboard under Instagram's com.instagram.sharedSticker.* keys
(expiring after five minutes) and open instagram-stories://share?source_application=<App ID>.
iOS has no official direct route to the Instagram feed, so feed calls open the system share sheet with the file and
the player picks Instagram there.
Scripts/Editor/InstagramShareIOSPostProcess.cs adds to Info.plist after every iOS build:
instagram and instagram-stories in LSApplicationQueriesSchemes, and a
NSPhotoLibraryAddUsageDescription text (kept if you already have one), because the share sheet offers
"Save Image" and iOS closes apps that save to Photos without one.
Folder layout
Assets/ ├── hardartcore/Instagram Share/ │ ├── Documentation.html this documentation │ ├── Scripts/ │ │ ├── InstagramShareHelper.cs the C# API │ │ └── Editor/ Info.plist build step, Help menu items │ ├── Plugins/ │ │ ├── Android/InstagramShare.androidlib/ │ │ │ ├── build.gradle androidx.core dependency, ProGuard rules │ │ │ └── src/main/ manifest, Java helper and FileProvider, shared paths │ │ └── iOS/InstagramShare.mm pasteboard, URL scheme and share sheet bridge │ └── Demo/ DemoScene, its scripts, Nunito font, icons └── StreamingAssets/InstagramShare/ the demo's image, sticker and video
The demo and StreamingAssets/InstagramShare can be deleted; the plugin does not use them.
Upgrading from 1.x
- Delete the old library Remove
Plugins/Android/instagram-share-release.aarandEditor/InstagramShareAndroidDependencies.xmlif they are still in the project: importing an update does not delete files. - Remove the old provider Delete the
<provider>you added toAssets/Plugins/Android/AndroidManifest.xmlfor this asset (the one pointing at@xml/file_paths), or the build fails with a missing resource. The<queries>entry andREAD_EXTERNAL_STORAGEare no longer needed either. - Set your App ID Add
InstagramShareHelper.FacebookAppId = "...";: Meta requires it for Stories, and Instagram shows an error without it. - Drop SetFileProvider Remove
SetFileProvider(...)calls, unless you keep sharing through your own provider.
Troubleshooting
- Nothing happens on share
- Instagram is not installed (check
IsInstagramInstalled()), or the file does not exist. - Instagram shows an error for Stories
- The Facebook App ID is empty or wrong.
- Failed to find configured root
- Android: the file is outside the shared folders. Save it under
Application.persistentDataPathorApplication.temporaryCachePath. - Duplicate class androidx.core...
- Another plugin copied
androidx.coreAAR files intoAssets/Plugins/Android(External Dependency Manager without Gradle templates). Turn on EDM's Patch mainTemplate.gradle option and resolve again. - Resource xml/file_paths not found
- The provider added for version 1.x is still in your manifest. See Upgrading.
- IsInstagramInstalled() is false on iOS
- Another build step replaced Info.plist after this one. Check that
LSApplicationQueriesSchemeslistsinstagramandinstagram-stories.
Third-party notices
The demo includes two third-party components. Everything else in the package is original work by HardArtcore. Instagram is a trademark of Meta Platforms, Inc.; this package is not affiliated with or endorsed by Meta.
| Component | Location | License |
|---|---|---|
| Nunito font Copyright 2014 The Nunito Project Authors (github.com/googlefonts/nunito) | Demo/UI/Fonts/ | SIL Open Font License 1.1 |
| Material Symbols icons Copyright Google LLC (github.com/google/material-design-icons) | Demo/UI/Icons/ | Apache License 2.0 |
The full licence texts ship in the package's Documentation.html, and online: SIL Open Font License 1.1, Apache License 2.0.
Release notes
2.0.0
- iOS support: Stories through Instagram's pasteboard API, feed sharing through the share sheet, the Info.plist entries added on build.
- Stories send your Facebook App ID (
InstagramShareHelper.FacebookAppId), which Meta requires. - Zero setup on Android: an Android library with its own FileProvider, the Instagram
<queries>entry, theandroidx.coredependency and ProGuard rules. No AAR, no manifest edits, no Gradle templates, no External Dependency Manager. - A new demo in portrait and landscape with a story preview; its media now ships in StreamingAssets.
- Unity 6 or newer.
1.3
- InstagramShareHelper is a static class: no need to add it to a scene.
1.2
- Option to set a custom file provider suffix.
Need help?
Questions, bug reports or feature requests: I usually reply within a day.
Last updated November 4, 2026.