AppFlowy-Cloud/admin_frontend/templates/pages/open_appflowy_or_download.html

34 lines
1.0 KiB
HTML

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>AppFlowy</title>
</head>
<body>
<script>
var fallbackLink = 'https://appflowy.io/download/'+window.location.search+window.location.hash;
// Mobile
const isiOS = navigator.userAgent.match('iPad') || navigator.userAgent.match('iPhone') || navigator.userAgent.match('iPod');
const isAndroid = navigator.userAgent.match('Android');
if (isiOS) {
fallbackLink = 'https://testflight.apple.com/join/6CexvkDz';
} else if (isAndroid) {
fallbackLink = 'https://play.google.com/store/apps/details?id=io.appflowy.appflowy';
}
window.location = 'appflowy-flutter://'+window.location.search+window.location.hash;
function checkFocus() {
if (document.hasFocus()) {
window.location = fallbackLink;
return;
}
setTimeout(checkFocus, 1000);
}
setTimeout(checkFocus, 500); // initial delay to wait for the app to open(or not)
</script>
</body>
</html>