Ibadan Life

Build an app for Ibadan Life

Every phone in the game has an app store: the App Store on an iPhone, the Play Store on Android, with the same apps in both. The apps in it are built by people who live here. This page is for code apps: one HTML file that runs inside the player's phone and can ask for their name, take a payment, and remember things.

Three ways to publish

First take the App developer job (it works from home and needs a laptop). Then open the phone's store and its second tab: Developer on an iPhone, Play Console on Android. Your first 3 publishes are free; after that each costs Ẹ20,000. You can have five apps in the store. Every app is read and tried by a person before it goes live, and again whenever you change its file, permissions or icon picture.

The file

The bridge

The phone adds ibadan to your page before your code runs. Every call returns a promise; a refusal rejects it with an Error whose message you can show. Declare what you need when you publish; a call you did not declare is refused. At most 20 calls in any 10 seconds.

ibadan.player()resolves with { name, area }

The player's username and the area they are in now (its short name, such as "bodija"). Needs "See your name and the area you are in". The phone asks the player once per app; if they say no, the promise rejects. They can take it back from the app's page.

ibadan.charge(amount, note)resolves with nothing

Asks the player to pay a whole number from 1 to Ẹ5,000. Needs "Ask you to pay (you confirm every time)". The phone shows its own sheet with your app's name, your username, the amount and your note (up to 80 characters) every time; your button can never move money by itself. It resolves once paid and rejects if they decline, can't pay, or your app has charged them Ẹ20,000 in the last 24 hours. You get 70%.

ibadan.storage.get(key)resolves with string or null

Reads a value you saved for this player. Needs "Keep a little of its own data for you" (no sheet: it is your app's own notes, listed on its page).

ibadan.storage.set(key, value)resolves with nothing

Saves a string for this player. Keys up to 40 characters, values up to 2,000, and 20 keys per player. A full shelf still updates keys it already has.

ibadan.toast(text)resolves with nothing

A short message over your app for 3 seconds (up to 120 characters).

ibadan.close()resolves with nothing

Closes your app and returns the player to their phone.

A starter to copy

The same file sits behind "Use the starter" in the upload form. Declare "See your name and the area you are in" and "Ask you to pay (you confirm every time)" for it to work.

<!doctype html>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>body{font:16px system-ui;margin:16px;color:#f3e9d7;background:#1b2430}button{font:inherit;padding:10px 14px;border-radius:12px;border:0;background:#9fe0b8}</style>
<h2 id="hi">Hello</h2>
<button id="buy">Buy pure water (50)</button>
<script>
  // ibadan.* is added by the phone. Every call returns a promise.
  ibadan.player().then(function (p) { document.getElementById("hi").textContent = "Hello " + p.name + " in " + p.area; }).catch(function () {});
  document.getElementById("buy").onclick = function () {
    ibadan.charge(50, "Pure water").then(function () { ibadan.toast("Paid. Cold one coming."); }).catch(function (e) { ibadan.toast(e.message); });
  };
</script>

To try it before review, open it from your own page in the store: a developer can run their own app while it waits. You can't pay yourself, so test a charge with a friend once it is live.

Getting into the store, and staying there

Open the game →