summaryrefslogtreecommitdiffstats
path: root/packages/meshbay-hub/src/meshbay_hub/static/platform.js
diff options
context:
space:
mode:
authorChristophe Besson <cbesson@gmail.com>2026-10-17 13:29:25 +0200
committerChristophe Besson <cbesson@gmail.com>2026-10-17 13:29:25 +0200
commit165847da1ca3c3be627b5968bc77e9a11b3385cb (patch)
tree603329a801d1304fdba833c1a8f4cd8c4ce4e7c6 /packages/meshbay-hub/src/meshbay_hub/static/platform.js
parenta1d18a2957d167444c6fc6c2e4ec8628509a7009 (diff)
downloadmeshbay-165847da1ca3c3be627b5968bc77e9a11b3385cb.tar.gz
feat(android): ask for the local network when a group opens
Android 17 makes it a permission for an application targeting SDK 37. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'packages/meshbay-hub/src/meshbay_hub/static/platform.js')
-rw-r--r--packages/meshbay-hub/src/meshbay_hub/static/platform.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/packages/meshbay-hub/src/meshbay_hub/static/platform.js b/packages/meshbay-hub/src/meshbay_hub/static/platform.js
index 3a91417d..d773200f 100644
--- a/packages/meshbay-hub/src/meshbay_hub/static/platform.js
+++ b/packages/meshbay-hub/src/meshbay_hub/static/platform.js
@@ -93,6 +93,20 @@ export const capabilities = {
};
/**
+ * Android 17's permission to reach the local network, in the Android
+ * application (shell/LocalNetwork.kt): `state()` is "granted", "prompt" while
+ * Android will still ask, or "denied" once only the settings can change it.
+ * Absent in a browser, which holds that permission itself and where a page
+ * cannot ask for it, and on the desktop, where there is no such permission.
+ */
+export const localNetwork = {
+ available: Boolean(bridge && bridge.localNetwork),
+ state() { return bridge.localNetwork.state(); },
+ request() { return bridge.localNetwork.request(); },
+ openSettings() { return bridge.localNetwork.openSettings(); },
+};
+
+/**
* The app's secret store, as far as the page may know it.
*
* The store is the main process's (the OS keychain through safeStorage) and it