MB3 (PBX spec 13 §5). Expo SDK 58 + Expo Router, with the PBX repo as a submodule for @selfphoneng/shared types (import type only). - pair by scanning the QR from My settings → Mobile app, by typing the server and code, or from a selfphoneng://pair link (waits for a tap) - the device token lives in expo-secure-store; a 401 goes back to pairing - home shows who and which extension the phone is paired as; Sign out removes the phone on the server too - README: Android APK build (and the Windows long-path fix), iPhone builds with ios-builder
SelfPhoneNG mobile
The Android and iPhone app for SelfPhoneNG, the
self-hosted business phone system. One Expo (React Native) codebase for both. What it does and
the order of work: the PBX repo's docs/spec/13-mobile.md.
Status: pairing with a PBX (MB3). Calls, history, voicemail, contacts and settings come next.
Get the code
git clone --recurse-submodules https://git.dou.bet/spng/mobile.git
npm install
vendor/selfphoneng is the PBX repo as a git submodule, for the shared types
(@selfphoneng/shared). After the PBX changes its API, move it forward:
git -C vendor/selfphoneng pull origin main && git add vendor/selfphoneng.
Develop
npm run typecheck
npm run lint
npx expo start # needs a development build on the phone (the app has native modules)
Pair a phone
On a computer, open the PBX's web page → My settings → Mobile app → Pair a phone. In the app, tap Scan the QR code (or type the server and code). The code works once, for 10 minutes.
Build and sideload
Android (on Windows, Linux or macOS)
Needs JDK 17+ and the Android SDK (ANDROID_HOME). The first build downloads the NDK and SDK
platforms it's missing.
npx expo prebuild --platform android
cd android && ./gradlew assembleRelease
Add -PreactNativeArchitectures=arm64-v8a for a faster build that runs on any recent phone.
On Windows the C++ build fails with ninja: error: mkdir(...): No such file or directory: the
paths pass 260 characters, and the CMake 3.22 that Gradle installs has a ninja that can't use
long paths. Turn on Windows long paths (LongPathsEnabled), install a newer CMake
(sdkmanager "cmake;3.31.6"), and after each expo prebuild point the build at it in
android/local.properties:
sdk.dir=C:/Users/<you>/AppData/Local/Android/Sdk
cmake.dir=C:/Users/<you>/AppData/Local/Android/Sdk/cmake/3.31.6
The APK is android/app/build/outputs/apk/release/app-release.apk, signed with the debug key:
copy it to the phone and open it (allow installing from unknown sources), or adb install it.
iPhone (no Mac needed)
ios-builder runs the Xcode build on a GitHub Actions macOS runner, so it needs this repo mirrored to GitHub.
- Download
builder-windows-amd64.exefrom its releases, rename it tobuilder.exe, put it on your PATH, thenbuilder auth github. - In this repo:
builder init. It adds.github/workflows/ios-build.ymlandbuilder.json. Setbuilder.jsonto{ "ios": { "path": "ios", "configuration": "Release" } }(Debug loads the JavaScript from a dev server). builder ios build --unsigned: the IPA lands in./dist/.- Install MobAI, connect the iPhone by USB,
builder mobai ping, thenbuilder mobai install dist/<file>.ipa. It re-signs with a free Apple ID (use a spare one): the app works for 7 days, then install it again.
License
AGPL-3.0-or-later, as the PBX.