forked from fkei/deeplink.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
demo.html
58 lines (51 loc) · 1.7 KB
/
demo.html
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
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no">
<title>Demo - deeplink.js</title>
<script src="./deeplink.js"></script>
</head>
<body>
<script>
// iOS
function launchiOS(mobile) {
if (mobile === "simple") {
deeplink.launchiOS({
storeLink: "https://itunes.apple.com/jp/app/twitter/id333903271?mt=8",
urlScheme: "twitter://timeline"
});
} else if (mobile === "user") {
deeplink.launchiOS({
storeLink: "https://itunes.apple.com/jp/app/twitter/id333903271?mt=8",
urlScheme: "twitter://user?screen_name=fkei"
});
}
};
// Android
function launchAndroid(mobile) {
if (mobile === "simple") {
deeplink.launchAndroid({
storeLink: "https://play.google.com/store/apps/details?id=com.twitter.android",
urlScheme: "twitter://timeline"
});
} else if (mobile === "user") {
deeplink.launchAndroid({
storeLink: "https://play.google.com/store/apps/details?id=com.twitter.android",
urlScheme: "twitter://user?screen_name=fkei"
});
}
};
</script>
<h2>iOS</h2>
<ul>
<li><button onClick="launchiOS('simple')">Simple</button></li>
<li><button onClick="launchiOS('user')">User - @fkei</button></li>
</ul>
<h2>Android</h2>
<ul>
<li><button onClick="launchAndroid('simple')">Simple</button></li>
<li><button onClick="launchAndroid('user')">User - @fkei</button></li>
</ul>
</body>
</html>