Appearance
A reply to a story
reelShareMessage({ mediaId, reelId?, text?, mediaType? }) builds the message; DirectBroadcast sends it to a conversation. Replies to a story (the swipe up on a story).
Example
Reply to a story. The example starts the app from a stored snapshot and sends over the layer, so its answer is the broadcast's: the server's response beside the client_context the request minted.
ts
import { AndroidApp } from '@igpapi/android';
import { DirectBroadcast, reelShareMessage, ThreadDirectTargetConfiguration } from '@igpapi/mobile';
import { Effect } from 'effect';
import { readFile } from 'node:fs/promises';
// A snapshot read back from your storage (see "Keep a session").
const snapshot = JSON.parse(await readFile('snapshot.json', 'utf8'));
// Reply to a story (the swipe up on a story): the story's media id and the reply's text.
const reply = DirectBroadcast({
target: new ThreadDirectTargetConfiguration('340282366841710300949128000000000001'),
message: reelShareMessage({ mediaId: '3000000000000000001_1000000001', text: 'Great story' }),
});
// One build of the layer is one app process; the program runs over it.
const sent = await Effect.runPromise(Effect.provide(reply, AndroidApp({ snapshot })));
console.log(sent.client_context);