diff options
| -rw-r--r-- | android/app/src/fcm/java/io/coinos/app/FcmService.java | 6 | ||||
| -rw-r--r-- | build.js | 2 | ||||
| -rw-r--r-- | static/coinos-beta.apk | bin | 0 -> 2107022 bytes |
3 files changed, 6 insertions, 2 deletions
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 @@ -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 Binary files differnew file mode 100644 index 0000000..4da2398 --- /dev/null +++ b/static/coinos-beta.apk |
