about summary refs log tree commit diff
path: root/src/platform
diff options
context:
space:
mode:
authorPaul Frazee <pfrazee@gmail.com>2022-06-14 20:29:24 -0500
committerPaul Frazee <pfrazee@gmail.com>2022-06-14 20:29:24 -0500
commitb2dd8d4f440243ac2eb12e7013d5a024b4e95f07 (patch)
tree42f78d330e2863a3229666c7d5fa09bec611e35b /src/platform
parent5066f3ba815d586f7d0f30135166aacf937480d6 (diff)
downloadvoidsky-b2dd8d4f440243ac2eb12e7013d5a024b4e95f07.tar.zst
Open login flow in in-app browser for native (WIP)
Diffstat (limited to 'src/platform')
-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}`
+  }
+}