Skip to content

Commit

Permalink
index.html 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
boring-km committed Aug 14, 2024
0 parents commit 724a6a8
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<!DOCTYPE html>
<html>

<head>
<title>Family Moments</title>
</head>

<body>

</body>

<script>
// 웹 페이지 로딩 완료 시 함수 호출
window.onload = function () {
setTimeout(
function () {
var visitedAt = (new Date()).getTime(); // 방문 시간
if ((new Date()).getTime() - visitedAt < 2000) {
location.href = "https://github.com/familymoments/family-moments-android";
}
}, 500);

var iframe = document.createElement('iframe');
iframe.style.visibility = 'hidden'; // 보이지 않는 iframe으로 스킴을 호출한다.

// query parameter를 이용하여 앱에 전달할 데이터를 설정한다.
const url = new URL(window.location.href);
const params = url.searchParams;
const invitationCode = params.get('code');

iframe.src = 'familymoments://invite?code=' + invitationCode; // 스킴 호출
document.body.appendChild(iframe);
document.body.removeChild(iframe); // back 호출시 캐싱될 수 있으므로 제거
};
</script>

</html>

0 comments on commit 724a6a8

Please sign in to comment.