StaticinstallA fresh install: a new device (from seed, a random one without it) and
no session. main receives the login home, after the pre-login launch.
Its otherwise answers a challenge over main's actions (the login
included): none comes before login on a clean install.
Static ReadonlylaunchA cold start of the app from a stored value — a snapshot (ExportSnapshot)
or a checkpoint (screen.checkpoint()), as an object (never JSON text): the
app launches with the stored user and main receives the screen the app
shows first, not the checkpoint's. The options are what the stored value
lacks.
A snapshot object may also be built by hand (AndroidSnapshotInput):
an account from another system, brought onto a phone of its own. The device
and the application are given whole or not at all (no device: the whole one
is made from seed, random without), the session is any subset; with a
signed-in session main receives the feed, without one the login home.
checkpoint() after the launch gives the library's own format.
Name the screen you expect (launch({ checkpoint, screen: FeedTimelineScreen, main }))
and main receives that handle; a screen the app shows instead — a
challenge the server raised over the start or over an action inside
main — is answered by a branch of otherwise (see defineOtherwise)
and the interrupted step runs again, and a screen no branch covers fails
the call with the typed UnexpectedScreenError. main never receives a
union of screens and needs no .is() narrowing.
Static ReadonlyresumeRestores the process and replays the enter flow of every screen of the
navigation chain from the root, as if the person walked the path again by
tapping. The screen argument, main and otherwise are as for
AndroidIgpapi.resumeFromBackground.
Static ReadonlyresumeContinues the checkpointed process as the app returning from the
background with the checkpoint's screen on top: it sends what the app sends
on coming back to the foreground. The screen argument, main
and otherwise are as for AndroidIgpapi.launch: a challenge those
requests run into is answered by a branch, and main still receives the
expected screen alone.
Static ReadonlyresumeContinues the checkpointed process on the checkpoint's own screen and sends
nothing: the process is indistinguishable on the wire from one that went
on. main receives that screen's handle — exactly the named screen's when
the call names it (resumeSilently({ checkpoint, screen: XxxScreen, main });
a checkpoint of another screen fails with the typed
CheckpointScreenMismatchError before any process is built), the union of
every screen handle otherwise. The restore sends nothing, so no challenge
can interrupt it; otherwise answers a challenge over main's actions.
One call is one Instagram Android app process, birth to death: it builds the process, starts it the way the entry names, runs
mainwith the screen that appears, and closes the process whenmainends — on success, on failure and when interrupted. Nothing is built, and nothing is sent, before the call. The process lives as long asmain: its handles must not outlive it, and to continue latermaintakesscreen.checkpoint()and a later call resumes (or launches) from it. NoScopeappears in a signature.The call resolves with
main's result. A typed failure of the start or ofmainrejects with the very same tagged error object; so does a failure of anotherwisebranch; a defect rejects with the defect.Every entry takes exactly one object: the process's options, the stored value (
checkpoint, orsnapshotforlaunch), the expectedscreen, theotherwisebranches, thesignalandmain.Guide: Ways to start the app