mob_background

Background execution keep-alive for Mob apps — keep the BEAM node running when the screen locks or the app is backgrounded.

Usage

# Keep the app alive when the screen locks (e.g. in mount/2):
MobBackground.keep_alive()
# Allow suspension again when no longer needed:
MobBackground.stop()

keep_alive/0 is idempotent — safe to call multiple times.

Install

# mix.exs
{:mob_background, "~> 0.1"}
# mob.exs
config :mob, :plugins, [:mob_background]
config :mob, :trusted_plugins, %{mob_background: "ed25519:<fingerprint>"}

mix mob.plugin.trust mob_background records the fingerprint, then mix mob.deploy --native.

Host requirements (the native build warns about these)

These can't be auto-injected, so they print as a warning on every mix mob.deploy --native of the host:

Notes

License

MIT.