-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
33 lines (32 loc) · 1.1 KB
/
index.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
<html>
<head>
<title>Javascript-Android Communication</title>
</head>
<body>
<br><a href="https://www.halodoc.com/tanya-dokter/cari?query=covid-19&is_retargeting=true&utm_source=Tanya-Jawab-Corona-High-Risk&shortlink=1285e06&utm_campaign=Tanya-Jawab-Corona&utm_medium=deeplink&c=Tanya-Jawab-Corona&pid=Tanya%20Jawab%20Corona&category_id=ed842b2a-546d-4e53-8648-17cfa727da4b">Full</a>
<script type="text/javascript">
function showAndroidToast(toast) {
console.log("showAndroidToast");
let request = {
request_id : "1234",
request_body : {
request_code: "user_profile.get_info",
data : {
}
},
callback : "JSMethodToSendResponse"
}
let json = JSON.stringify(request)
console.log(json);
window.webkit.messageHandlers.JSToNativeBridge.postMessage(json);
}
function JSMethodToSendResponse(response){
let json = JSON.stringify(response)
console.log(json);
}
</script>
<form>
<input type="button" value="Click me!" onclick="showAndroidToast('Hello Android!')" />
</form>
</body>
</html>