Documentation

Facebook Story Kit

Share images, videos and stickers from Unity to Facebook Stories and Reels on Android and iOS, with no Facebook SDK and no manual setup.

  • Version 2.0.0
  • Unity 6000.0+
  • Platforms Android, iOS
  • Updated Nov 4, 2026
Facebook Story Kit

Overview

Facebook Story Kit shares images, videos and stickers from your Unity game to Facebook Stories and Reels, on Android and iOS. One static C# class opens the Facebook app with your content ready to post. There is no Facebook 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).

Requirements

ItemVersionNotes
Unity6000.0+Android and/or iOS build support installed
com.unity.ugui2.0+The demo's UI only
Facebook appcurrentInstalled on the player's device. Without it, the share calls do nothing and IsFacebookInstalled() returns false.
Facebook App IDFrom developers.facebook.com. Facebook requires it for every share.

Android needs nothing else: the plugin's Android library declares its own FileProvider, the <queries> entry for the Facebook app and the androidx.core dependency, which Gradle downloads from Google's Maven repository during the build. On iOS, a build step adds the Facebook URL schemes to Info.plist.

Quick start

  1. Import the package The plugin lands in Assets/hardartcore/FacebookStoryShare and the demo media in Assets/StreamingAssets/FacebookStoryShare.
  2. Set your App ID Once, before the first share: FacebookStoryShareHelper.FacebookAppId = "1234567890";
  3. Save a file Write the image or video to Application.persistentDataPath or Application.temporaryCachePath.
  4. Share it Call one of the share methods with the file's absolute path. Build to an Android or iOS device with the Facebook app installed.
ShareButton.cs
using Hardartcore.Facebook;
using UnityEngine;

public class ShareButton : MonoBehaviour
{
    private void Awake()
    {
        FacebookStoryShareHelper.FacebookAppId = "1234567890";
    }

    public void Share()
    {
        var path = Application.persistentDataPath + "/score.png";
        if (FacebookStoryShareHelper.IsFacebookInstalled())
        {
            FacebookStoryShareHelper.ShareImageToFacebookStory(path);
        }
    }
}
In the Editor

Every call is a safe no-op in the Editor and on other platforms, and IsFacebookInstalled() returns false there. Test sharing on a device.

The demo

Open Demo/Scenes/DemoScene. It copies the sample image.jpg, sticker.png and video.mp4 out of StreamingAssets/FacebookStoryShare into Application.persistentDataPath (Facebook needs real files), shows the image and sticker in a story preview, and has one button per share call. Set your App ID on the Demo object's DemoSceneScript before building.

The status chip shows whether the Facebook app is installed. When it is missing on a device, the share buttons are disabled. The layout adapts to portrait and landscape.

Share a screenshot

ShareScreenshot.cs
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);

    FacebookStoryShareHelper.ShareImageToFacebookStory(path);
}

API reference

Everything is on the static class Hardartcore.Facebook.FacebookStoryShareHelper. Paths are absolute file paths. Colours are hex strings such as "#CC3322".

FacebookAppId
string. Your Facebook App ID. Set it before sharing.
IsFacebookInstalled()
bool. True when the Facebook app is on the device. Share calls do nothing without it.
ShareImageToFacebookStory(image, attributionLink = null)
An image as the story background.
ShareImageWithStickerToFacebookStory(image, sticker, attributionLink = null)
An image background with a sticker on top, which the player can move and resize.
ShareStickerWithGradientToFacebookStory(sticker, topColor, bottomColor, attributionLink = null)
A sticker on a two-colour gradient. The same colour twice gives a solid background.
ShareVideoToFacebookStory(video, attributionLink = null)
A video as the story background.
ShareVideoWithStickerToFacebookStory(video, sticker, attributionLink = null)
A video background with a sticker on top.
ShareVideoReel(video, attributionLink = null)
A video to the Reels composer.
ShareVideoReelWithSticker(video, sticker, attributionLink = null)
A video to the Reels composer with a sticker on top.
SetFileProvider(suffix)
Android Not needed: the plugin has its own provider. Use it only to share through a FileProvider you declared yourself, passing its authority suffix with a leading dot (".fileprovider" for com.your.game.fileprovider).
GetExternalFilesPath(name)
Android The path of the app-specific external directory name (Context.getExternalFilesDir). Null elsewhere.
CopyFile(name)
Android Copies StreamingAssets/name to the app-specific external files folder. The demo shows a cross-platform way with UnityWebRequest.
attributionLink

Android only, and Facebook only shows it for apps it has approved for attribution links. iOS ignores it.

Media specs

Facebook's limits, from its Sharing to Stories and Sharing to Reels guides:

AssetFormatsRecommended
Story imageJPG, PNG9:16
Story videoH.264, H.265, WebM1080p or more, up to 20 seconds, under 50 MB
Reel videoH.264, H.265, WebM1080p, 3 to 60 seconds, under 50 MB
StickerJPG, PNG640×480, transparent PNG for a cut-out look

How it works

Android

Each call builds a Facebook intent (com.facebook.stories.ADD_TO_STORY or com.facebook.reels.SHARE_TO_REEL), turns your file paths into content:// URIs with the plugin's FileProvider, grants Facebook read access to them and starts the Facebook app. The Android library Plugins/Android/FacebookStoryShare.androidlib adds to your build:

FileProvider
com.hardartcore.facebook.FacebookStoryFileProvider with the authority <your application id>.hardartcore.fbstory. Its own class name, so it never clashes with another plugin's or your own FileProvider.
Shared folders
External storage, the app's files folder and cache folder: Application.persistentDataPath and Application.temporaryCachePath work whether they are external or internal. No storage permission is needed.
Queries
<queries><package android:name="com.facebook.katana"/></queries>, so Android 11+ lets the app see Facebook.
Dependency
androidx.core:core:1.9.0 in the library's build.gradle. Gradle picks the highest version when other plugins need it too.
ProGuard
proguard-rules.pro keeps com.hardartcore.facebook.**, which C# calls by name, when you enable minification.

iOS

Each call puts your file data on the pasteboard under Facebook's com.facebook.sharedSticker.* keys (expiring after five minutes) and opens facebook-stories://share or facebook-reels://share. Scripts/Editor/FacebookShareIOSPostProcess.cs adds facebook-stories and facebook-reels to LSApplicationQueriesSchemes in Info.plist after every iOS build, so canOpenURL can see Facebook.

Reels on iOS

Facebook only accepts Reels from apps in Live mode in the App Dashboard.

Folder layout

Assets/
├── hardartcore/FacebookStoryShare/
│   ├── Documentation.html                 this documentation
│   ├── Scripts/
│   │   ├── FacebookStoryShareHelper.cs    the C# API
│   │   └── Editor/                        Info.plist build step, Help menu items
│   ├── Plugins/
│   │   ├── Android/FacebookStoryShare.androidlib/
│   │   │   ├── build.gradle               androidx.core dependency, ProGuard rules
│   │   │   └── src/main/                  manifest, Java helper and FileProvider, shared paths
│   │   └── iOS/FacebookStoryShare.mm      pasteboard + URL scheme bridge
│   └── Demo/                              DemoScene, its scripts, Nunito font, icons
└── StreamingAssets/FacebookStoryShare/    the demo's image, sticker and video

The demo and StreamingAssets/FacebookStoryShare can be deleted; the plugin does not use them.

Upgrading from 1.x

  1. Delete the old library Remove Plugins/Android/facebook-release.aar and Editor/FacebookShareAndroidDependencies.xml if they are still in the project: importing an update does not delete files.
  2. Remove the old provider Delete the <provider> you added to Assets/Plugins/Android/AndroidManifest.xml for this asset (the one pointing at @xml/file_paths), or the build fails with a missing resource. The <queries> entry and READ_EXTERNAL_STORAGE are no longer needed either.
  3. Move your App ID Replace the edited FacebookAppId constant with FacebookStoryShareHelper.FacebookAppId = "...";
  4. Drop SetFileProvider Remove SetFileProvider(...) calls, unless you keep sharing through your own provider.

Troubleshooting

Nothing happens on share
The Facebook app is not installed (check IsFacebookInstalled()), or the file does not exist. Facebook also shows an error when the App ID is empty or wrong.
Failed to find configured root
Android: the file is outside the shared folders. Save it under Application.persistentDataPath or Application.temporaryCachePath.
Duplicate class androidx.core...
Another plugin copied androidx.core AAR files into Assets/Plugins/Android (External Dependency Manager without Gradle templates). Turn on EDM's Patch mainTemplate.gradle option and resolve again, so Gradle resolves every dependency once.
Resource xml/file_paths not found
The provider added for version 1.x is still in your manifest. See Upgrading.
IsFacebookInstalled() is false on iOS
Another build step replaced Info.plist after this one. Check that LSApplicationQueriesSchemes in the Xcode project lists facebook-stories and facebook-reels.

Third-party notices

The demo includes two third-party components. Everything else in the package, including the scripts, plugins and the rest of the demo, is original work by HardArtcore. Facebook is a trademark of Meta Platforms, Inc.; this package is not affiliated with or endorsed by Meta.

ComponentLocationLicense
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: every Story and Reel call, through the pasteboard and Facebook's URL schemes, with the Info.plist schemes added on build.
  • Zero setup on Android: an Android library with its own FileProvider, the Facebook <queries> entry, the androidx.core dependency and ProGuard rules. No AAR, no manifest edits, no Gradle templates, no External Dependency Manager.
  • FacebookStoryShareHelper.FacebookAppId replaces editing a constant in the plugin.
  • A new demo in portrait and landscape with a story preview; its media now ships in StreamingAssets.
  • Unity 6 or newer.

1.4

  • FacebookStoryShareHelper is a static class: no need to initialise it or add it to a scene.

1.3

  • Share videos to Facebook Reels.

Need help?

Questions, bug reports or feature requests: I usually reply within a day.

support@hardartcore.com

Last updated November 4, 2026.