about summary refs log tree commit diff
path: root/src/platform/urls.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/platform/urls.tsx')
-rw-r--r--src/platform/urls.tsx12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/platform/urls.tsx b/src/platform/urls.tsx
new file mode 100644
index 000000000..958b5232d
--- /dev/null
+++ b/src/platform/urls.tsx
@@ -0,0 +1,12 @@
+import {isIOS, isAndroid} from './detection'
+
+export function makeAppUrl(path = '') {
+  if (isIOS) {
+    return `pubsqapp://${path}`
+  } else if (isAndroid) {
+    return `pubsq://app${path}`
+  } else {
+    // @ts-ignore window exists -prf
+    return `${window.location.origin}${path}`
+  }
+}