Skip to content

Share a reel ​

What the person sees. They watch a reel and tap the paper plane under it. The Direct share sheet opens with the conversations the app keeps on the device, and the reel goes into the conversation they tap.

The reel's share sheet with its conversations

What you do. A reel of the reels viewer is an item of ReelsViewerScreen. Its share() opens the Direct share sheet, and the sheet's threads rows send with send(). When the viewer is the Reels tab's root, the sheet can build the share: the reel's attribution and its inventory are the viewer's own, not the caller's.

ts
import { AndroidIgpapi, FeedTimelineScreen } from '@igpapi/android';
import { Effect } from 'effect';
import { readFile } from 'node:fs/promises';

const saved = JSON.parse(await readFile('session.json', 'utf8'));

await AndroidIgpapi.launch({
  checkpoint: saved,
  screen: FeedTimelineScreen,
  main: feed =>
    Effect.gen(function* () {
      // The Reels tab's root is the viewer: the reel in front is the one the share names.
      const viewer = yield* feed.openReelsTab();
      const reel = viewer.current;
      if (reel === undefined) return;
      const sheet = yield* reel.share();
      const conversation = sheet.threads[0];
      if (conversation === undefined) return;
      return yield* conversation.send();
    }),
});

The wire. The GraphQL IGDirectClipShareMutationWithResponse, the 451 app's own mutation for a shared reel: the conversation's id, the reel's pk, the viewer's chaining session, send_attribution=clips_viewer_clips_tab and inventory_source=recommended_clips_chaining_model.

The conversation selected in the reel's share sheet

The reel's share sheet after sending

The reel share shown in the conversation

The pages of this site are the README files of the repository. The API reference is generated from the source.