Bonjour,
J'essaie de créer un lien qui permettra selon l'OS de l'utilisateur de rediriger soit vers l’Apple ou le google play afin de télécharger l'application en question. Ou bien d'ouvrir l'application si celui-ci est déjà installé.
J'ai essayé de suive ce tutoriel: https://blog.axawebcenter.fr/mobile/...s-un-site-web/
j'ai donc le code suivant:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
| <!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Mon Axa Redirect</title>
<meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<script type="text/javascript">
function openApp() {
var isIpad = navigator.userAgent.match(/iPad/i) != null;
var isIphone = !isIpad && ((navigator.userAgent.match(/iPhone/i) != null) || (navigator.userAgent.match(/iPod/i) != null));
var isIos = isIpad || isIphone;
var isAndroid = !isIos && navigator.userAgent.match(/android/i) != null;
if (isIos) {
window.location = "COM.MONAXA://profile";
setTimeout(function() {
if (!document.webkitHidden) {
window.location = 'https://itunes.apple.com/fr/app/id862440857';
}
}, 25);
} else if (isAndroid) {
window.location = 'intent://profile#Intent;package=fr.axa.monaxa;scheme=COM.MONAXA;end;';
//window.location = 'market://details?id=com.appsfit.android';
} else {
//window.location = 'https://client.axa.fr';
}
}
</script>
</head>
<body onload="openApp();">
</body>
</html> |
Lorsque j'essaie d'ouvrir la page depuis un téléphone Android rien ne se passe.
La page est disponible à ce lien : http://exeo51.free.fr/
J'ai l'impression que le code cidessous ne fonctionne pas:
window.location = 'intent://profile#Intent;package=fr.axa.monaxa;scheme=COM.MONAXA;end;';
Pouvez vous me dire comment faire.
Partager