Appearance
Direct
What the person sees. Direct messages: the inbox, a conversation, the recipient picker for a new message or a group, a conversation's details with its shared media, the group name editor and a participant's nickname editor.
What you do. You open the inbox (DirectInboxScreen) and a conversation (DirectThreadScreen), write and react to messages, send a photo from the composer's gallery picker (DirectMediaPickerPhotosScreen), a voice message, a GIF or a sticker from the composer's tray (DirectStickerTabTrayScreen), start a one-to-one conversation or a group through the recipient picker (DirectRecipientPickerScreen), look at a conversation's details (DirectThreadDetailsScreen) and its shared media (DirectThreadSharedMediaScreen), rename a group (DirectGroupNameAndPhotoEditorScreen) and give a participant a nickname (DirectThreadNicknameChangeScreen).
The inbox is the feed's Direct tab; a conversation is also reached from a profile's "Message" button.
Every example starts from session.json, the session Your first program saved, and names the screen it expects (screen: FeedTimelineScreen). The examples show the success path: errors are answered as in Errors, and challenges by your otherwise constant (Challenges: answer them once with otherwise).
ts
import { AndroidIgpapi, DirectMediaPickerPhotosScreen, FeedTimelineScreen } from '@igpapi/android';
import { Effect } from 'effect';
import { readFile } from 'node:fs/promises';
// A checkpoint read back from your storage (see "Keep a session").
const saved = JSON.parse(await readFile('session.json', 'utf8'));The pages of this area
| Page | The screen |
|---|---|
| The Direct inbox | DirectInboxScreen, the feed's Direct tab |
| A conversation | DirectThreadScreen, a conversation and its messages |
| The forwarding sheet | DirectForwardingSheetScreen, a message forwarded |
| The Imagine flow | DirectImagineCreationScreen, the composer's AI images |
| The draw editor | DirectDoodleEditorScreen, a drawing over a message |
| The gallery picker | DirectMediaPickerPhotosScreen, the composer's "+" gallery |
| The sticker tray | DirectStickerTabTrayScreen, its GIF and sticker tabs |
| "New message": the recipient picker | DirectRecipientPickerScreen, "New message" and the new group |
| A conversation's details | DirectThreadDetailsScreen, a conversation's details hub |
| A conversation's shared media | DirectThreadSharedMediaScreen, the thread's shared media |
| The group name and photo editor | DirectGroupNameAndPhotoEditorScreen |
| A participant's nickname editor | DirectThreadNicknameChangeScreen |
| The Direct share sheet | DirectShareSheetScreen, the paper plane's conversations |
The matrix
| # | The person... | Starts on | Actions | Result |
|---|---|---|---|---|
| 1 | Opens the Direct tab | the feed | openDirectTab(), threads | The inbox with its thread previews |
| 2 | Opens a conversation | the inbox | the thread item's open(), messages, participants | The conversation and its messages |
| 3 | Writes a message | a conversation | sendMessage(text) | The text broadcast to the conversation |
| 4 | Sends a photo from the gallery | a conversation | openMediaPicker(), sendPhoto({ file }) | The picker, then the photo message |
| 5 | Sends a voice message | a conversation | sendVoice({ file }) | The voice message, its waveform measured from the take |
| 6 | Sends a GIF | a conversation | openStickerTray(), openGifTab(), the GIF row's send() | The tray and its GIF list, then the GIF message |
| 7 | Sends a sticker | a conversation | openStickerTray(), openStickerTab(), the sticker row's send() | The tray and its sticker grid, then the store sticker |
| 8 | Uses a message's menu | a conversation | the message's react({ emoji }), reply(text), forward(), edit(text), unsend() | The reaction, the reply, the forwarding sheet, the edit or the unsend |
| 9 | Starts a one-to-one conversation | the inbox | openNewMessage(), search(query), the recipient's or the thread's openThread() | The picker, its ranked recipients, then the conversation |
| 10 | Creates a group chat | the inbox | openNewMessage(), startGroupChat(), search(query), createGroup(rows) | The created group's conversation |
| 11 | Writes to someone from their profile | a profile | openDirectThread(), sendMessage(text) | The one-to-one conversation with that user |
| 12 | Looks at a conversation's details and media | a conversation | openThreadDetails(), openSharedMedia() | The details hub, then the shared media list |
| 13 | Renames a group | a group conversation | openThreadDetails(), openSharedMedia(), openGroupNameEditor(), changeName(name) | The group's new title |
| 14 | Gives a participant a nickname | a conversation | the participant's openNicknameEditor(), changeNickname(nickname) | The nickname changed |
| 15 | Shares a post, a carousel, a reel or a profile | a post, a carousel, a reel or a profile | its share(), the sheet row's send() | The item in that conversation |
| 16 | Sends a video from the gallery | a conversation | openMediaPicker(), sendVideo({ file }) | The picker, then the video message |
| 17 | Sends an AI image from Imagine | a conversation | openImagine(), generate(prompt), send({ file }) | The Imagine flow, then the generated image as a photo |
| 18 | Draws over a message | a conversation | the message's draw(), the editor's send({ file }) | The draw editor, then the drawing as a message |
Reading new messages
A conversation is a snapshot of what Instagram answered when you opened it. To read messages that arrived later, open the inbox and the conversation again.
The group name
The group name editor is opened from the shared media list (openGroupNameEditor()), which follows the conversation's details (scenario 13).
What these screens do not offer
Message requests (the inbox reads the main list only), the story camera and the picker's Imagine tile (the flow opens from the conversation's "+"), a voice message's recording (the take's file is the caller's), muting a conversation, deleting a chat, and leaving, hiding, restricting or blocking from a group's options. The app has them; the Simulator has no action for them.
Where the examples live
Each directory's README carries the examples of its own screen:
- Open the inbox —
inbox/ - Open a conversation, write a message, use a message's menu, send a photo, a video or a voice message, draw over a message, open the Imagine flow, write from a profile —
thread/, whose menu's own types have a page each: a reply, an edited message, an unsent message - Forward a message —
forwarding-sheet/ - The composer's gallery picker, its photo and its video —
media-picker/ - The sticker tray, its GIF tab and its sticker grid —
sticker-tray/ - The composer's AI images —
imagine/ - A drawing over a message —
doodle/ - Start a one-to-one conversation, create a group chat —
recipient-picker/ - Look at the details and the shared media —
details/,shared-media/ - Rename a group —
group-editor/ - Give a participant a nickname —
nickname/ - Share a post, a carousel, a reel or a profile —
share-sheet/