From b1ce268ca2158a6888f504c507f7451d5a2b0dee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=86=A1=EC=98=81=EB=AF=BC?= Date: Sun, 14 Jan 2024 19:00:48 +0900 Subject: [PATCH] feat: fix ios router --- app/o/[id]/page.tsx | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/app/o/[id]/page.tsx b/app/o/[id]/page.tsx index 66ab502..ea8b79c 100644 --- a/app/o/[id]/page.tsx +++ b/app/o/[id]/page.tsx @@ -10,6 +10,7 @@ export default function Page() { const playStoreUrl = 'https://play.google.com/store/apps/details?id=com.no5ing.bbibbi' + (id ? '&referrer='+id : ''); const [platform, setPlatform] = useState<"unknown" | "ios" | "android">("unknown"); const retry = searchParams.get("retry"); + const iosTargetUrl = retry ? appStoreUrl : 'https://no5ing.kr/o/'+id; useEffect(() => { const detectPlatform = () => { const unknownWindow = ((window as unknown) as any); @@ -30,11 +31,7 @@ export default function Page() { }, []); const handleRoute = () => { if(platform == "ios") { - if(retry) { - location.href = appStoreUrl; - } else { - location.href = 'https://no5ing.kr/o/'+id+'?retry=1'; - } + location.href = iosTargetUrl; } else if (platform == "android") { location.href = 'intent://no5ing.kr/o/'+id+'#Intent;scheme=https;action=android.intent.action.VIEW;category=android.intent.category.BROWSABLE;package=com.no5ing.bbibbi;end'; }