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 --- android/app/src/fcm/java/io/coinos/app/FcmService.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'android/app/src/fcm') 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 -- cgit v1.2.3