Try to intent:// into android app from tab

This commit is contained in:
Owen
2026-01-11 10:39:39 -08:00
parent 78b00a18cc
commit 89682a2ee4

View File

@@ -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() {
</p>
</>
);
}
}