#TIL : Create cross-platform downloading app URL

You have a mobile app for both platforms iOS and Android, each platform has different download URL. But your user doesn’t know which platform he using. Clicking wrong URL will lead to user bounce-rate.

Solution is making only 1 URL to download your app, which can redirect to right place depends on using platform. So how we achieve this ??

The key of problem is detecting user platform, which can be done by extracting the User-Agent header from http request.

Platform User-Agent pattern
iOS contains iPhone or iPad or iPod
Android contains Android

This is how I implement using Caddy web server, you can do same thing in Apache or NGINX

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
app.yourcompany.com:443 {
timeouts 1m

redir 302 {
if_op or
if {>User-agent} has iPhone
if {>User-agent} has iPod
if {>User-agent} has iPad
/ [apple-store-url]
}

redir 302 {
if {>User-agent} has Android
/ [google-play-url]
}

redir 302 {
if {>User-agent} not_has iPhone
if {>User-agent} not_has iPod
if {>User-agent} not_has iPad
if {>User-agent} not_has Android
/ [your-landing-page-which-user-visit-on-desktop-device]
}
}

Then we get cool and easy to remember link, right ?

SMTPor : Dead simple SMTP testing tool

Never need a bigass mail client to test your SMTP config !

Github Repo : https://github.com/khanhicetea/smtpor

Demo

SMTPor

TL;DR

Using Docker to run

1
$ docker run -d -p 3000:3000 khanhicetea/smtpor

Then open http://localhost:3000 to try a shot !

Install & Start

1
2
$ npm install
$ npm start

Heroku Deploying

1
2
3
$ heroku login
$ heroku git:remote -a [your-app-name]
$ git push heroku master

Contributors

  • @khanhicetea

License

MIT License