-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
42 lines (41 loc) · 1.98 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
34
35
36
37
38
39
40
41
42
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bootstrap demo</title>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
<script>
if (navigator.userAgent.indexOf('median') > -1) {
function median_info_ready(inAppPurchases) {
console.log("median_info_ready")
console.log(inAppPurchases);
const products = inAppPurchases["inAppPurchases"]["products"]
const container = document.getElementById("iap");
products.forEach(function(product) {
var element2 = "<div class='d-flex w-100 justify-content-between'>"
var element3 = `<h5 class='mb-1'>${product.localizedTitle}</h5>`
var element4 = `<small class="price">${product.priceFormatted}</small>`
var element5 = "</div>"
var element6 = `<p class="mb-1">${product.localizedDescription}</p>`
var on = document.createElement("a");
on.classList.add("list-group-item", "list-group-item-action")
on.id = product.productID
on.href = `median://purchase/${product.productID}`
on.innerHTML = element2 + element3 + element4 + element5 + element6
container.appendChild(on);
});
}
}
function restore_purchases() {
median.iap.restorePurchases();
}
</script>
</head>
<body>
<h1>In-App Purchases</h1>
<div id="iap"></div>
<button id="" onclick="restore_purchases">Restore Purchases</button>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script>
</body>
</html>