From fc5ac3df7477e416c4241d6e88b13d9f5190e40a Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Fri, 6 Nov 2026 23:18:27 -0700 Subject: Coinos Beta (io.coinos.beta, 1.14-beta) is published for a trial at https://v3.coinos.io/coinos-beta.apk — the wallet in its own WebView with Firebase push, installed beside the current app. Built with the coinos-v3 Firebase project's config (android/app/google-services.json, fetched with the project's service account through the Firebase Management API; gitignored) and signed with the usual key; nwcpush sends fcm: endpoints with the same service account (on cs in the nwcpush state, config fcm.serviceAccount). Verified on a Pixel 9: the token reaches the page as its push endpoint, and a data message sent through FCM v1 woke the off-screen wallet ("wake: job started", the service worker's NWC responder up) and raised its notification. Not on Zapstore. FcmService no longer resets the "endpoint handed to the page" flag when the first token arrives a second time through onNewToken MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01VMan6Ts5Tktega8VbLg31q --- .../app/src/fcm/java/io/coinos/app/FcmService.java | 6 +++++- build.js | 2 +- static/coinos-beta.apk | Bin 0 -> 2107022 bytes 3 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 static/coinos-beta.apk diff --git a/android/app/src/fcm/java/io/coinos/app/FcmService.java b/android/app/src/fcm/java/io/coinos/app/FcmService.java index 24d4aca..bc3e514 100644 --- a/android/app/src/fcm/java/io/coinos/app/FcmService.java +++ b/android/app/src/fcm/java/io/coinos/app/FcmService.java @@ -8,7 +8,11 @@ public class FcmService extends FirebaseMessagingService { @Override public void onNewToken(String token) { // a rotated token is a new endpoint; the page gets it on its next load - if (token != null && !token.isEmpty()) Push.setEndpoint(this, Fcm.PREFIX + token); + if (token == null || token.isEmpty()) return; + // the first token also comes through Fcm.register, which may already + // have handed it to the page — only a different one starts over + String ep = Fcm.PREFIX + token; + if (!ep.equals(Push.endpoint(this))) Push.setEndpoint(this, ep); } @Override diff --git a/build.js b/build.js index 1a6f097..85d4245 100644 --- a/build.js +++ b/build.js @@ -608,7 +608,7 @@ if (import.meta.main) { // The Android builds. coinos.apk is the TWA (Chrome renders the site); // graphene.apk runs the wallet in its own WebView so a phone without // Google Play Services can be woken — see android/. - for (const apk of ['coinos.apk', 'graphene.apk']) { + for (const apk of ['coinos.apk', 'graphene.apk', 'coinos-beta.apk']) { if (await Bun.file('static/' + apk).exists()) { await Bun.write('dist/' + apk, Bun.file('static/' + apk)); } diff --git a/static/coinos-beta.apk b/static/coinos-beta.apk new file mode 100644 index 0000000..4da2398 Binary files /dev/null and b/static/coinos-beta.apk differ -- cgit v1.2.3