Skip to content

Instantly share code, notes, and snippets.

@paulofierro
Last active August 29, 2015 13:55
Show Gist options
  • Save paulofierro/8733957 to your computer and use it in GitHub Desktop.
Save paulofierro/8733957 to your computer and use it in GitHub Desktop.
<html>
<head>
<title>Token viewer</title>
<style>
body {
text-align:center;
font-family:'Helvetica Neue';
}
</style>
</head>
<body>
<h1>Your device token is:</h1>
<h1 id="token"></h1>
<h2><a id="email">Tap to email it</a></h2>
<script>
var url = document.URL;
var param = '&token=';
var index = url.indexOf(param);
var token = url.substring(index + param.length, url.length);
var h1 = document.getElementById('token');
h1.textContent = token;
var link = document.getElementById('email');
link.setAttribute('href', 'mailto:?subject=Device Token&body=Your device token is ' + token);
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment