Hacker News

Top stories

Live mirror
30 storiesupdated just nowView source snapshot
  1. F-Droid 2.0(f-droid.org)
    102comments
  2. Show HN: Whiteboard (YC W26) – An open-source IDE for thoughtful software design(github.com/devdotfast)
    3comments
  3. Two-tier encryption in the UK(macanorak.com)
    264comments
  4. WaveDigger: Dig into wireless signals to discover their physical locations(github.com/christianrowlands)
    4comments
  5. Nokia Design Archive (2025)(aalto.fi)
    94comments
  6. GitHub has not removed malicious imitation software after 3 weeks(successfulsoftware.net)
    56comments
  7. Google’s Project Suncatcher to put ML infrastructure in space(blog.google)
    13comments
  8. Toyota is taking the Corolla electric(electrek.co)
    18comments
  9. Apple iPhone 4 “Antennagate” Q&A (2010) [video](youtube.com)
    5comments
  10. B5-BJ2 – Ice Cream Barges – Concrete Ship Constructors (2023)(thecretefleet.com)
    3comments
  11. Search – A small, fast WebKit browser for macOS(github.com/driceroland)
    —discuss
  12. Linux support is coming to Snapdragon X2 series(qualcomm.com)
    244comments
  13. The forgotten battle of East Lansing(eastlansinginfo.news)
    —discuss
  14. Experiencing writing at our recent Chinese calligraphy workshop(viewsproject.wordpress.com)
    1comments
  15. Ideas on modernizing the open-source desktop(lwn.net)
    420comments
  16. The science of Monkey Island: can grog dissolve a metal mug that fast?(jgeekstudies.org)
    19comments
  17. My Weird New Hobby: Wandering Around Tokyo on Google Maps(ahmedhossamdev.com)
    1comments
  18. Geothermal heat map of US hot springs(soakingsprings.com)
    3comments
  19. Book review: Is parallel programming hard, and, if so, what can you do about it?(ahelwer.ca)
    —discuss
  20. RAM: the forgotten history (2024)(coredump.cx)
    3comments
  21. When the Debugger Lies(danielmangum.com)
    17comments
  22. ArXiv receives multiyear commitments to support it as an independent nonprofit(arxiv.org)
    38comments
  23. Enjoy Every Sandwich(bradmontague.substack.com)
    80comments
  24. Coulomb's law remains tricky to test at home(chillphysicsenjoyer.substack.com)
    16comments
  25. The newest ESP32 can run Linux and it's getting close to a Raspberry Pi(xda-developers.com)
    84comments
  26. VSCode's SSH Agent Is Bananas (2025)(fly.io)
    190comments
  27. Contrastive Language Models(contrastive-lm.notion.site)
    46comments
  28. Oracle cites 'force majeure' to shield itself on controversial data center(bloomberg.com)
    92comments
  29. The "Windows XP Box" (2003)(mini-itx.com)
    45comments
  30. Fixing the Portobello Police Station Clock(pointinthecloud.com)
    113comments

QR codes that route to the appropriate app store

16 pointsby 2h agomatthuggins.com
9 comments
1h agoHN ↗

Is this a whole blog post for a simple backend that just routes based on the User-Agent?

1h agoHN ↗

I thought it was something clever, but it shows as URL in QR Scanner, not an APP, which opens browser after activating it, then user would have to confirm redirect to App Store on empty page

TL;DR: it is HTTP redirect based on User-Agent header

1h agoHN ↗

it's just a server side redirect based on the user agent headers

1h agoHN ↗

Err wut... redirecting based on user agents?

1h agoHN ↗

I hate QR codes. I don't trust them.

55m agoHN ↗

For our apps Slyp and SlypBusiness, we had the same QR code for each app open Playstore/Appstore page of the app depending on the phone. Hopefully, we will start rolling out Slyp next week.

Just have a branded link (like https://slyp.app/Slyp or https://slyp.app/SlypBusiness) to the official web page and have the js in that page auto-redirect and open the original Playstore/Appstore page.

And yes, we used userAgent for identifying the platform.

If anyone is interested, here is the code. May not cover all edge cases but works for our usecase. The code was wrung together in a hurry a year ago.

    window.addEventListener('DOMContentLoaded', (event) => {
        let app = 'Slyp'

        var userAgent = navigator.userAgent.toLowerCase();
        if (userAgent.indexOf('android') > -1) {
          window.location.href = `https://play.google.com/store/apps/details?id=com.ndcurve.${app}`;
        } else if (userAgent.indexOf('iphone') > -1 || userAgent.indexOf('ipod') > -1 || userAgent.indexOf('ipad') > -1 || userAgent.indexOf('mac') > -1) {
              if (app === "Slyp")
                window.location.href = 'https://apps.apple.com/app/<app_id>';
              else if (app === "SlypBusiness")
                window.location.href = 'https://apps.apple.com/app/<app_id>';
              else
                window.location.href = 'https://slyp.app';
        } else {
          window.location.href = `https://play.google.com/store/apps/details?id=com.ndcurve.${app}`;
        }
    });
50m agoHN ↗

I agree with the other commenters that this is a pretty simple engineering problem, but I still enjoyed reading about edge cases the author worked to address (they could have taken the easy road with this but tried not to). I forgot that Safari on iPad doesn't specify iPad in user agent headers