aboutsummaryrefslogtreecommitdiffstats
path: root/packages/meshbay-hub/src/meshbay_hub/static/platform.js
diff options
context:
space:
mode:
Diffstat (limited to 'packages/meshbay-hub/src/meshbay_hub/static/platform.js')
-rw-r--r--packages/meshbay-hub/src/meshbay_hub/static/platform.js16
1 files changed, 16 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 e3b3d2d..c70b03a 100644
--- a/packages/meshbay-hub/src/meshbay_hub/static/platform.js
+++ b/packages/meshbay-hub/src/meshbay_hub/static/platform.js
@@ -214,6 +214,22 @@ export const playback = {
},
};
+/**
+ * Notifications on this device while the application is closed — fetched, or
+ * pushed through a UnifiedPush distributor when the phone has one. Only the
+ * Android application does this; `available` is false in a browser and on a
+ * desktop, and nothing here is then called. See push.js.
+ */
+export const push = {
+ available: Boolean(bridge && bridge.push),
+ status() { return bridge.push.status(); },
+ enable() { return bridge.push.enable(); },
+ disable() { return bridge.push.disable(); },
+ remember(subscription, account, secret, since) {
+ return bridge.push.remember(subscription, account, secret, since);
+ },
+};
+
/** Pick a directory to add as a group root. Returns { path, name } or null. */
export const rootPicker = {
available: Boolean(bridge && bridge.rootPicker),