Skip to content

Instantly share code, notes, and snippets.

@petermanser
Last active December 17, 2015 18:59
Show Gist options
  • Save petermanser/5656745 to your computer and use it in GitHub Desktop.
Save petermanser/5656745 to your computer and use it in GitHub Desktop.
Showing the concept of app link redirects.
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLName</key>
<string>io.pillow.app</string>
<key>CFBundleURLSchemes</key>
<array>
<string>pillowapp</string>
</array>
</dict>
</array>
<!DOCTYPE html>
<html>
<head>
<title>pillow - redirecting...</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body {
background:#F4F4EF;
font-family:'Trebuchet MS';
font-size:3em;
}
body,
a, a:visited, a:active {
color:#333333;
}
#content{
left: 0;
margin-top: -200px;
position: absolute;
text-align: center;
top: 50%;
width: 100%;
}
img {
width: 75px;
}
#link img {
width:250px;
}
body.loading #link {
display:none;
}
body.loaded #loader {
display:none;
}
</style>
</head>
<body class="loading">
<div id="content">
<h1>pillow</h1>
<img id="loader" src="/static/img/loader.gif" />
<a id="link" href="https://itunes.apple.com/ch/app/pillow/id646315788">
<p>Hol dir jetzt die iPhone App!</p>
<img src="/static/img/appstore.png" />
</a>
</div>
<script>
setTimeout(function(){
window.location = 'pillowapp://whateveryoulikehere/1';
setTimeout(function(){
document.getElementsByTagName('body')[0].className='loaded'
}, 1000);
}, 250);
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment