mirror of
https://github.com/fosrl/pangolin.git
synced 2026-01-28 22:00:51 +00:00
Try to intent:// into android app from tab
This commit is contained in:
@@ -27,18 +27,21 @@ export default function DeviceAuthSuccessPage() {
|
|||||||
const isIOS = /iPad|iPhone|iPod/.test(userAgent) && !(window as any).MSStream;
|
const isIOS = /iPad|iPhone|iPod/.test(userAgent) && !(window as any).MSStream;
|
||||||
const isAndroid = /android/i.test(userAgent);
|
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
|
// Wait 500ms then attempt to open the app
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
// Try to open the app using deep link
|
// Try to open the app using deep link
|
||||||
window.location.href = "pangolin://";
|
window.location.href = "pangolin://";
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
if (isIOS) {
|
|
||||||
window.location.href = "https://apps.apple.com/app/pangolin/net.pangolin.Pangolin.PangoliniOS";
|
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";
|
|
||||||
}
|
|
||||||
}, 2000);
|
}, 2000);
|
||||||
}, 500);
|
}, 500);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user