From f87a909674d299f4742f8960cb15fcb9bdf65155 Mon Sep 17 00:00:00 2001 From: syui Date: Tue, 18 Nov 2025 15:39:58 +0900 Subject: [PATCH] fix --- public/oauth/callback/index.html | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/public/oauth/callback/index.html b/public/oauth/callback/index.html index b676e1e..0365e63 100644 --- a/public/oauth/callback/index.html +++ b/public/oauth/callback/index.html @@ -100,21 +100,28 @@ return; } - // Universal Links用: 現在のHTTPS URLがそのままアプリに渡される - // iOSがUniversal Linkを認識すれば自動的にアプリが開く - console.log('Waiting for Universal Link to trigger...'); + // カスタムスキームのDeep Linkを生成 + const deepLink = `aicard://oauth/callback?code=${encodeURIComponent(code)}&state=${encodeURIComponent(state)}`; - // 3秒後にフォールバックメッセージを表示 + console.log('OAuth callback received, attempting app launch...'); + console.log('Universal Link should trigger automatically if configured correctly'); + + // 即座にカスタムスキームへのリダイレクトを試行(フォールバック) + // Universal Linksが動作すればこのコードに到達する前にアプリが開く + // 動作しない場合はカスタムスキームで開く setTimeout(() => { - // カスタムスキームのDeep Linkを生成(フォールバック用) - const deepLink = `aicard://oauth/callback?code=${encodeURIComponent(code)}&state=${encodeURIComponent(state)}`; + console.log('Attempting fallback custom scheme redirect'); + window.location.href = deepLink; + }, 500); + // 2秒後に手動ボタンを表示(念のため) + setTimeout(() => { content.innerHTML = `
認証が完了しました

アプリが自動的に開かない場合は、
下のボタンをタップしてください

アプリを開く `; - }, 3000); + }, 2000); } catch (err) { console.error('Callback error:', err);