Skip to content

Commit c90bd3b

Browse files
committed
added test verify page
1 parent 65289fd commit c90bd3b

File tree

1 file changed

+34
-11
lines changed

1 file changed

+34
-11
lines changed

misc/verify.html

Lines changed: 34 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,46 @@
11
<html>
2+
23
<head>
3-
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
4-
<meta name="viewport" content="width=device-width,minimum-scale=1.0, maximum-scale=1.0" />
5-
<title>Kaki Verify</title>
6-
<style>@media screen and (max-device-width:480px){body{-webkit-text-size-adjust:none}}</style>
4+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
5+
<meta name="viewport" content="width=device-width,minimum-scale=1.0, maximum-scale=1.0" />
6+
<title>Kaki Verify</title>
7+
<style>
8+
@media screen and (max-device-width:480px) {
9+
body {
10+
-webkit-text-size-adjust: none
11+
}
12+
}
13+
</style>
714

8-
<!-- implement javascript on web page that first first tries to open the deep link
15+
<!-- implement javascript on web page that first first tries to open the deep link
916
1. if user has app installed, then they would be redirected to open the app to specified screen
1017
2. if user doesn't have app installed, then their browser wouldn't recognize the URL scheme
1118
and app wouldn't open since it's not installed. In 1 second (1000 milliseconds) user is redirected
1219
to download app from app store.
1320
-->
14-
<script>
21+
<script>
22+
var getQueryString = function ( field, url ) {
23+
var href = url ? url : window.location.href;
24+
var reg = new RegExp( '[?&]' + field + '=([^&#]*)', 'i' );
25+
var string = reg.exec(href);
26+
return string ? string[1] : null;
27+
};
1528
window.onload = function() {
16-
<!-- Deep link URL for existing users with app already installed on their device -->
17-
window.location = 'kaki://join?screen=xxxxx';
18-
<!-- Download URL (TUNE link) for new users to download the app -->
19-
setTimeout("window.location = 'https://play.google.com/store/apps/details?id=app.kaki';", 1000);
29+
30+
debugger;
31+
var package = getQueryString('app'); // returns 'chicken'
32+
var sportId = getQueryString('sport'); // returns 'sandwich'
33+
var code = getQueryString('code'); // returns null
34+
35+
<!-- Deep link URL for existing users with app already installed on their device -->
36+
var finalDeeplink = 'kaki://join?'+sportId+'#'+code;
37+
alert(finalDeeplink);
38+
window.location = finalDeeplink;
39+
40+
<!-- Download URL for new users to download the app -->
41+
setTimeout("window.location = 'https://play.google.com/store/apps/details?id=app.kaki';", 1000);
2042
}
21-
</script>
43+
</script>
2244
</head>
45+
2346
</html>

0 commit comments

Comments
 (0)