API Reference mob v#0.8.2

Copy Markdown View Source

Modules

Mob

Mob — BEAM-on-device mobile framework for Elixir.

What one action did, and which layer is answerable if it did nothing.

A bounded record of recent action receipts, and the telemetry bridge.

Owns the receipts ETS table, and does nothing else.

Native alert dialogs, action sheets, and toast messages.

Behaviour for Mob application entry point.

Microphone recording and audio playback.

Drawing-op constructors for Mob.UI.canvas/1.

CA-certificate loading for mob apps. Companion to Mob.DNS — same shape: a small wrapper documenting and working around something OTP assumes about the OS that Android doesn't satisfy.

System clipboard access. No permission required.

Behaviour for native view components.

Pure-Elixir composite components: the third expansion pass.

Hostname → IP resolution that works around BEAM's broken DNS path on iOS and physical Android devices.

Entry points that convert what the framework's detectors produce into capsules on the defect bus.

The bounded record of defects the framework has emitted, and the fanout to whoever subscribed to hear about them.

Owns Mob.Defect.Bus's ETS tables and the subscriber registry.

A defect, in the shape a consumer can act on.

A defect sink that formats every emitted capsule as a Logger line.

Cross-platform device events and queries.

Android-specific device events. Symmetrical with Mob.Device.IOS.

iOS-specific device events. Subscribers receive events that either have no Android counterpart (e.g. :protected_data_did_become_available) or carry extra iOS fidelity beyond what Mob.Device exposes cross-platform.

Runtime diagnostics that run inside a Mob app's BEAM. Designed to be invoked via Erlang RPC from a developer's machine to inspect the actual state of a deployed app.

Compare two Mob.Test.view_tree/1 snapshots and report the first divergence.

Platform-aware Erlang distribution startup.

The unified event emission API for Mob.

Canonical address for an event in the Mob view tree.

Translates legacy event shapes ({:tap, tag}, {:change, tag, value}, {:tap, {:list, id, :select, index}}) into the canonical {:mob_event, %Address{}, event, payload} envelope.

Behaviour for stateful event-owning components.

Resolves a target: spec to a concrete delivery pid.

Throttle / debounce config for high-frequency event subscriptions.

Live tracing of Mob events for IEx debugging.

System file picker. Opens the OS document picker (Files app on iOS, SAF on Android).

Font-name utilities backing the theme system's fonts: token map — see Mob.Theme for the fonts: / font_fallback: fields these support.

mix format plugin for the ~MOB sigil.

Haptic feedback. No permission required on either platform.

Checks the framework can make about itself, and the rule that stops them becoming noise.

The checks the framework ships with, and an honest list of the ones it does not yet.

Owns the invariant registry and violation tables.

One confirmed invariant breach.

Data-driven list component.

The single process the native layer delivers interaction events to.

Bridge between Phoenix LiveView and the Mob native WebView.

Accelerometer, gyroscope, and magnetometer (compass) sensor data.

OTP logger handler that routes Elixir Logger output to the platform's native system log.

Multi-stack navigation state.

ETS-backed registry mapping screen name atoms to their modules.

Request OS-level permissions from the user.

On-device access to the activated plugins' tier-3/4 contributions.

Dispatches OS foreground/background transitions to the tier-4 plugins' lifecycle.on_resume / lifecycle.on_background hooks.

Supervises the tier-4 plugins' lifecycle.

Collect the post-mortems the OS and the BEAM leave behind when a process dies, and put them onto Mob.Defect.Bus as capsules.

ApplicationExitInfo-backed post-mortem ingest for Android.

Scan for erl_crash.dump files the BEAM leaves behind, and turn each into a defect capsule.

MetricKit-backed post-mortem ingest for iOS.

A one-shot record of post-mortem artifacts we have already emitted a capsule for.

Maps component names (atoms) to their platform-specific NIF constructors.

Per-frame timing for the render pipeline, readable from a connected node.

Serializes a component tree to JSON and passes it to the platform NIF in a single call. Compose (Android) and SwiftUI (iOS) handle diffing and rendering internally.

Owns navigation, and the one process per live screen that serves it.

Behaviour and GenServer wrapper for a Mob screen.

One process per live screen, owning that screen's socket.

Raised by the handle_event/3 use Mob.Screen injects when a screen defines no clause for an event.

The blessed way to unit-test a Mob.Screen in the BEAM, no device or emulator required. The screen-level analog of Phoenix.LiveViewTest.

A screen under test. Two backends, same query/assertion surface

Persistent store for screen assigns.

The only process permitted to call the render NIFs.

System share sheet. Opens the OS share dialog with a piece of content. Fire-and-forget — no response arrives in the BEAM.

The ~MOB sigil for declarative native UI.

The socket struct passed through all Mob.Screen and Mob.Component callbacks.

Text-to-speech. No permission required on either platform.

Persistent key-value store for app state.

App-local file storage.

Android-specific storage locations and MediaStore integration.

iOS-specific storage locations and media library integration.

Thin wrapper around a props map for named, reusable styles.

Remote inspection and interaction helpers for connected Mob apps.

Design token system for Mob apps.

Theme that follows the OS-level light / dark setting.

GenServer that re-resolves the active theme when the OS appearance flips.

High-contrast greyscale dark theme.

High-contrast greyscale light theme.

Rear-camera torch (flashlight) on/off. No permission required on either platform — the torch is toggled directly, without opening a camera session.

UI component constructors for the Mob framework.

Raw USB host access via vendor bulk endpoints. Android only.

Bidirectional JS bridge for the native WebView component.

Mix Tasks

Format .erl files (or check formatting with --check).

Run the test suite until it fails, or a set number of times, and report which tests were not deterministic.

Runs the Mob onboarding integration tests, which verify that a new user can go from zero to a running app without hitting any friction that should have been caught automatically.