Skip to content

Instantly share code, notes, and snippets.

@nickhsu
Created July 24, 2015 02:56
Show Gist options
  • Save nickhsu/816fb07b7ebed6223677 to your computer and use it in GitHub Desktop.
Save nickhsu/816fb07b7ebed6223677 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
body {
padding-top: 40px;
}
</style>
<title>WKWebView Demo</title>
<meta charset="UTF-8">
</head>
<body>
<h1>WKWebView Test</h1>
</body>
<script>
var WeaviSDK = {
setBadgeNumber: function(counter) {
try {
webkit.messageHandlers.setBadgeNumber.postMessage(counter);
} catch(err) {
console.log('The native context does not exist yet');
}
}
};
WeaviSDK.setBadgeNumber(100);
</script>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment