-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
"use client" | ||
import {useEffect, useState} from "react"; | ||
|
||
export default function Page() { | ||
const appStoreUrl = 'https://itunes.apple.com/kr/app/id393499958'; | ||
const [isIphone, setIsIphone] = useState(false); | ||
useEffect(() => { | ||
const isIphone = () => { | ||
const unknownWindow = ((window as unknown) as any); | ||
const userAgent = navigator.userAgent || navigator.vendor || unknownWindow.opera; | ||
if (/iPad|iPhone|iPod/.test(userAgent) && !unknownWindow.MSStream) return true; | ||
return false; | ||
} | ||
|
||
const iphone = isIphone(); | ||
if(iphone) { | ||
setTimeout(() => { | ||
location.href = appStoreUrl; | ||
}, 50); | ||
} | ||
setIsIphone(iphone); | ||
}, []); | ||
return <> | ||
{!isIphone ? <span>iPhone만 접근할 수 있습니다.</span> : <span>AppStore로 이동중..<br/><a href={appStoreUrl}>직접 이동하기</a></span>} | ||
</>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export default function Page() { | ||
return <a>개발자</a>; | ||
} |