igpapi — Instagram private API Simulator for Node.js (API reference) 4.14.0
    Preparing search index...

    Class AndroidIgpapi

    One call is one Instagram Android app process, birth to death: it builds the process, starts it the way the entry names, runs main with the screen that appears, and closes the process when main ends — on success, on failure and when interrupted. Nothing is built, and nothing is sent, before the call. The process lives as long as main: its handles must not outlive it, and to continue later main takes screen.checkpoint() and a later call resumes (or launches) from it. No Scope appears in a signature.

    The call resolves with main's result. A typed failure of the start or of main rejects with the very same tagged error object; so does a failure of an otherwise branch; a defect rejects with the defect.

    const checkpoint = await AndroidIgpapi.install({
    seed,
    main: home =>
    Effect.gen(function* () {
    const search = yield* home.recoverPassword();
    const codeEntry = yield* search.findAccount(email);
    return yield* codeEntry.checkpoint();
    }),
    });
    await AndroidIgpapi.resumeSilently({
    checkpoint,
    screen: AccountRecoveryAuthenticationConfirmationScreen,
    main: screen => screen.logInWithCode(code),
    });

    Every entry takes exactly one object: the process's options, the stored value (checkpoint, or snapshot for launch), the expected screen, the otherwise branches, the signal and main.

    Guide: Ways to start the app

    Index

    Methods

    • A 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.

      Type Parameters

      Parameters

      Returns Promise<A>

    Properties

    launch: AndroidLaunchEntry = launchEntry

    A 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.

    resumeByReentering: AndroidResumeEntry = ...

    Restores 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.

    resumeFromBackground: AndroidResumeEntry = ...

    Continues 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.

    resumeSilently: AndroidResumeEntry = ...

    Continues 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.