Skip to content

Commit

Permalink
fix: download-link
Browse files Browse the repository at this point in the history
  • Loading branch information
Arnaud AMBROSELLI committed Dec 6, 2023
1 parent 0ad66b7 commit 491baf8
Showing 1 changed file with 76 additions and 0 deletions.
76 changes: 76 additions & 0 deletions pages/download-link.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
import Head from "next/head"

import {
ANDROID_APP_ID,
ANDROID_URL,
IOS_APP_ID,
IOS_URL,
ROOT_URL,
} from "../constants"

// ANDROID_URL
// IOS_URL

const download = () => {
return (
<Head>
<meta charset="UTF-8" />
<title>Télécharger OzEnsemble</title>
<meta
property="og:title"
content="Télécharger OzEnsemble"
key="download"
/>
<meta
name="description"
content="Télécharger Oz Ensemble, l'une application mobile pour maitriser sa consommation d'alcool."
key="download"
/>
<meta
property="og:description"
content="Télécharger Oz Ensemble, l'une application mobile pour maitriser sa consommation d'alcool."
key="download"
/>
<meta property="og:image" content="/images/logo_oz.png" />
<meta property="og:type" content="article" />
<meta property="fb:app_id" content="100089366502471" />
{/* <meta property="al:ios:url" content="myapp://element/{ELEMENT_ID}" /> */}
<meta property="al:ios:app_store_id" content={IOS_APP_ID} />
<meta property="al:ios:app_name" content="Oz Ensemble" />
{/* <meta property="al:android:url" content="myapp://element/{ELEMENT_ID}" /> */}
<meta property="al:android:app_name" content="Oz Ensemble" />
<meta property="al:android:package" content={ANDROID_APP_ID} />
<meta property="al:web:url" content={ROOT_URL} />
<meta property="al:web:should_fallback" content="false" />
<script
dangerouslySetInnerHTML={{
__html: `
function redirect() {
var userAgent = navigator.userAgent || navigator.vendor || window.opera;
var ios = /iPad|iPhone|iPod/.test(userAgent) && !window.MSStream;
if (ios) {
// window.location = myapp://element/{ELEMENT_ID};
window.setTimeout(() => {
window.location.replace('${IOS_URL}');
}, 25)
return
}
var android = /android/i.test(userAgent);
if (android) {
// window.location = myapp://element/{ELEMENT_ID};
window.setTimeout(() => {
window.location.replace('${ANDROID_URL}');
}, 25)
return
}
window.location.replace('${ROOT_URL}')
}
redirect()
`,
}}
/>
</Head>
)
}

export default download

0 comments on commit 491baf8

Please sign in to comment.