Hearth documentation

Native apps and push notifications

Hearth's phone and desktop apps sign in with the same steps as the web, two-factor included. This page covers what the server needs for them: the builds it hands out, the oldest builds it still accepts, and push notifications.

For installing the apps as a person, see Phone apps and Desktop sync.

Get the apps

Administration, Get the apps lists the app builds this server hands out: for each platform (Android, iOS) the latest build first, with its version, build number, date, size and commit, and Older versions below.

Builds also update themselves: the apps ask Hearth for the latest build's manifest, which is signed, and download the new build from Hearth.

The releases folder

Hearth only reads the builds; a release script on the host writes them. Mount the folder read only and name it:

    environment:
      APP_RELEASES_DIR: /data/app-releases
    volumes:
      - ./data/app-releases:/data/app-releases:ro

The folder holds:

Write a new index.json beside the old one and rename it into place; Hearth reads it again when it changes. Without APP_RELEASES_DIR, the page shows no builds.

Oldest builds accepted

When an old build can no longer work with the server, refuse it:

NATIVE_MIN_BUILD_IOS: "120"
NATIVE_MIN_BUILD_MACOS: "40"
NATIVE_MIN_BUILD_ANDROID: "115"

A build below its minimum gets the answer 426 app_update_required and shows "Update Hearth". The iPad app counts as iOS. 0, the default, accepts any build. The addresses the apps update through stay open to an old build, so it can always update itself.

The phone sign-in

The apps stay signed in while they are used. An app's sign-in ends only after APP_SESSION_IDLE_DAYS without use (180 by default), when the person signs out, signs out everywhere, changes their password, or when the device is wiped from Hearth. Each app shows in the person's Sessions list.

Push notifications

Notifications reach phones as push notifications, sent straight from Hearth to Apple and to Google. No third-party push service is involved.

iPhone and iPad (APNs)

From your Apple developer account you need an APNs key (a .p8 file), its key ID, your team ID, and the app's bundle ID:

PUSH_APNS_KEY_FILE: /run/hearth/apns-key.p8
PUSH_APNS_KEY_ID: ABC123DEFG
PUSH_APNS_TEAM_ID: TEAM123456
PUSH_APNS_TOPIC: org.example.hearth

Set all four or none.

Android (Firebase Cloud Messaging)

PUSH_FCM_SERVICE_ACCOUNT_FILE: /run/hearth/fcm-service-account.json

The file is a Google service account's JSON key for the Firebase project the Android app belongs to.

Push works only for app builds made for the same Apple team and Firebase project as these keys. To check it, a signed-in app can ask for a test notification to its owner's phones (POST /api/v1/push/test).

Hearth publishes /.well-known/apple-app-space-association and /.well-known/assetlinks.json for the apps, so phones offer Hearth's passkeys and saved passwords inside the apps and open Hearth links (public links, Files, Talk, Mail, Calendar) in the app when it is installed. The app identities in these files are fixed in Hearth's code, not settings; builds under another identity need a change there.