From 89682a2ee453904125ad0ada2c2d440dc01e572b Mon Sep 17 00:00:00 2001 From: Owen Date: Sun, 11 Jan 2026 10:39:39 -0800 Subject: [PATCH] Try to intent:// into android app from tab --- src/app/auth/login/device/success/page.tsx | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/app/auth/login/device/success/page.tsx b/src/app/auth/login/device/success/page.tsx index 49261cb6..6ee49587 100644 --- a/src/app/auth/login/device/success/page.tsx +++ b/src/app/auth/login/device/success/page.tsx @@ -27,18 +27,21 @@ export default function DeviceAuthSuccessPage() { const isIOS = /iPad|iPhone|iPod/.test(userAgent) && !(window as any).MSStream; const isAndroid = /android/i.test(userAgent); - if (isIOS || isAndroid) { + if (isAndroid) { + // For Android Chrome Custom Tabs, use intent:// scheme which works more reliably + // This explicitly tells Chrome to send an intent to the app, which will bring + // SignInCodeActivity back to the foreground (it has launchMode="singleTop") + setTimeout(() => { + window.location.href = "intent://auth-success#Intent;scheme=pangolin;package=net.pangolin.Pangolin;end"; + }, 500); + } else if (isIOS) { // Wait 500ms then attempt to open the app setTimeout(() => { // Try to open the app using deep link window.location.href = "pangolin://"; setTimeout(() => { - if (isIOS) { - window.location.href = "https://apps.apple.com/app/pangolin/net.pangolin.Pangolin.PangoliniOS"; - } else if (isAndroid) { - window.location.href = "https://play.google.com/store/apps/details?id=net.pangolin.Pangolin"; - } + window.location.href = "https://apps.apple.com/app/pangolin/net.pangolin.Pangolin.PangoliniOS"; }, 2000); }, 500); } @@ -79,4 +82,4 @@ export default function DeviceAuthSuccessPage() {

); -} +} \ No newline at end of file