By accessing and using this functionality, you acknowledge and agree to be bound by the Meta Platform Terms and Developer Policies. You also represent and warrant that any content made available through your application or website, or shared to Facebook Reels from your application or website, does not infringe upon the intellectual property rights of any third party and that you own, control or have otherwise secured all rights necessary to distribute, copy, publicly perform and display, or otherwise use the content via this functionality, including as uploaded and shared on Facebook Reels. You further represent and warrant that you have the authority to make the foregoing representations on behalf of your organization. If you do not have such authority or are otherwise unable to make the foregoing representations, you are not authorized to continue and should not do so.

Sharing to Facebook Reels From Android

You can integrate sharing into your Android app so that users can share video content to Facebook Reels. To create a new app, see Getting Started with the Facebook SDK for Android.

Facebook Reel Layers

The Facebook Reels composer has a background video layer and an optional sticker layer.

  • Background Video Layer – A video fills the screen.
  • Sticker Layer – An optional sticker can appear in front of the video.

Download the Sharing Icon

For a consistent user experience across apps, download the standard sharing icon and use it in your app. The sharing icon looks like the following:

Implement Sharing

You use an Implicit Intent to launch the Facebook app and send it content for Reels. The Facebook app receives the content, loads it in the Reels composer, and the user can edit and publish the content to their Facebook Reels.

In general, your sharing flow does the following:

  1. Instantiate an intent with the SHARE_TO_REEL action.
  2. Attach content to the intent.
  3. Instantiate an activity.
  4. Verify that the activity can resolve the intent and start the activity.

Remove any temporary files that you create on the user's device.

Data

You send the following data to the Facebook app.

DataTypeDescriptionRequired

Facebook App ID

String

Your Facebook App ID.

Yes

Video Asset

Uri

The URI for a video that is a local file on the user's device. Videos can be 1080p and should be between 3 and 60 seconds in duration. Acceptable video formats are H.264, H.265, and WebM, and the recommended dimensions are device fullscreen or smaller.

Yes

Sticker Asset

Uri

The URI for an image that is a local file on the user's device. Acceptable image formats are JPG and PNG, and the recommended dimensions are 640 x 480. The image appears over the video.

No

Example

The following code example sends a video to Facebook so the user can edit and publish it to their Facebook Reels.

// Instantiate an intent
Intent intent = new Intent("com.facebook.reels.SHARE_TO_REEL");

// Attach your App ID to the intent
String appId = "1234567890";
intent.putExtra("com.facebook.platform.extra.APPLICATION_ID", appId);

// Option 1: Attach your video to the intent from a URI
Uri videoAssetUri = Uri.parse("your-video-uri-goes-here");
intent.setDataAndType(videoAssetUri, "video/mp4");
intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);

// Option 2: Attach your video to the intent from a file
Uri mediaUri = createExternalURIFromResource(R.raw.reel_video, "video.mov");
intent.setData(mediaUri);
intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);

// Instantiate an activity
Activity activity = getActivity();

// Verify that the activity resolves the intent and start it
if (activity.getPackageManager().resolveActivity(intent, 0) != null)
{
  activity.startActivityForResult(intent, 0);
}

Example With Sticker

The following code example sends a video to Facebook, and includes an optional sticker, so the user can edit and publish it to their Facebook Reels.

// Instantiate an activity
Activity activity = getActivity();

// Verify that the activity resolves the intent and start it
if (activity.getPackageManager().resolveActivity(intent, 0) != null)
{
  activity.startActivityForResult(intent, 0);
}

private void share()
{
  // Instantiate an intent
  Intent intent = new Intent("com.facebook.reels.SHARE_TO_REEL");

  // Attach your App ID to the intent
  String appId = "1234567890";
  intent.putExtra("com.facebook.platform.extra.APPLICATION_ID", appId);

  // Option 1: Attach your video to the intent from a URI
  Uri videoAssetUri = Uri.parse("your-video-uri-goes-here");
  intent.setDataAndType(videoAssetUri, "video/mp4");
  intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);

  // Option 2: Attach your video to the intent from a file
  Uri mediaUri = createExternalURIFromResource(R.raw.reel_video, "video.mov"");
  intent.setData(mediaUri);
  intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);

  // Attach a sticker to the intent
  Uri stickerUri = createExternalURIFromResource(R.raw.logic_music_sticker, "sticker.jpg");
  intent.putExtra("interactive_asset_uri", uri);
  intent.putExtra("top_background_color", "#71b280");
  intent.putExtra("bottom_background_color", "#71b280");

  // Give permissions to receiving app
  List<ResolveInfo> resolveInfoList =
    getActivity()
      .getPackageManager()
      .queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY);

  for (ResolveInfo resolveInfo : resolveInfoList)
  {
    String packageName = resolveInfo.activityInfo.packageName;

    getActivity().grantUriPermission(packageName, uri, Intent.FLAG_GRANT_READ_URI_PERMISSION);
  }

  startActivityForResult(intent, PLATFORM_REQUEST_CODE //2);
}


private Uri createExternalURIFromResource(int resourceId, String filename)
{
  try
  {
    File parent = new File(FacebookSdk.getApplicationContext().getFilesDir(), SHARED_PATH //"share");
    parent.mkdir();
    File file = new File(parent, filename);
    copy(resourceId, file);
    return FileProvider.getUriForFile(getContext(), "com.facebook.hackbook.fileprovider", file);
   }
   catch (IOException ex)
   {
     throw new RuntimeException("Unable to share content", ex);
   }
}


public static void copy(int resourceId, File dst) throws IOException
{
  InputStream in = FacebookSdk.getApplicationContext().getResources().openRawResource(resourceId);
  OutputStream out = new FileOutputStream(dst);

  // Transfer bytes from in to out
  byte[] buf = new byte[1024];
  int len;
  while ((len = in.read(buf)) > 0)
  {
    out.write(buf, 0, len);
  }
  in.close();
  out.close();
}