Skip to content

Instantly share code, notes, and snippets.

@schnabear
Created December 5, 2018 09:15
Show Gist options
  • Save schnabear/5c394b75781d92b38416732f299cffb3 to your computer and use it in GitHub Desktop.
Save schnabear/5c394b75781d92b38416732f299cffb3 to your computer and use it in GitHub Desktop.
updateBadge HTML
<!DOCTYPE html>
<html>
<head>
<title>updateBadge</title>
<script>
function updateBadgeCount() {
var badgeCountEl = document.querySelector('#badgeCount');
var customLocation = "native://updateBadge?count=" + badgeCountEl.value;
console.log(customLocation);
document.location.href = customLocation;
}
</script>
</head>
<body>
<a href="native://updateBadge?count=0">Count 0</a>
<a href="native://updateBadge?count=5">Count 5</a>
<a href="native://updateBadge?count=10">Count 10</a>
<a href="native://updateBadge?count=100">Count 100</a>
<form action="#">
<input type="text" value="" id="badgeCount" />
<button type="button" onclick="updateBadgeCount()">SET</button>
</form>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment