Hacker News

Top stories

Live mirror
30 storiesupdated just nowView source snapshot
  1. F-Droid 2.0(f-droid.org)
    100comments
  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)
    263comments
  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)
    54comments
  7. Toyota is taking the Corolla electric(electrek.co)
    16comments
  8. Search – A small, fast WebKit browser for macOS(github.com/driceroland)
    —discuss
  9. Linux support is coming to Snapdragon X2 series(qualcomm.com)
    244comments
  10. Experiencing writing at our recent Chinese calligraphy workshop(viewsproject.wordpress.com)
    1comments
  11. Apple iPhone 4 “Antennagate” Q&A (2010) [video](youtube.com)
    5comments
  12. Google’s Project Suncatcher to put ML infrastructure in space(blog.google)
    10comments
  13. B5-BJ2 – Ice Cream Barges – Concrete Ship Constructors (2023)(thecretefleet.com)
    3comments
  14. Ideas on modernizing the open-source desktop(lwn.net)
    418comments
  15. The science of Monkey Island: can grog dissolve a metal mug that fast?(jgeekstudies.org)
    19comments
  16. Geothermal heat map of US hot springs(soakingsprings.com)
    3comments
  17. RAM: the forgotten history (2024)(coredump.cx)
    3comments
  18. When the Debugger Lies(danielmangum.com)
    17comments
  19. ArXiv receives multiyear commitments to support it as an independent nonprofit(arxiv.org)
    38comments
  20. Enjoy Every Sandwich(bradmontague.substack.com)
    80comments
  21. Coulomb's law remains tricky to test at home(chillphysicsenjoyer.substack.com)
    16comments
  22. The newest ESP32 can run Linux and it's getting close to a Raspberry Pi(xda-developers.com)
    82comments
  23. VSCode's SSH Agent Is Bananas (2025)(fly.io)
    190comments
  24. Contrastive Language Models(contrastive-lm.notion.site)
    46comments
  25. Oracle cites 'force majeure' to shield itself on controversial data center(bloomberg.com)
    91comments
  26. The "Windows XP Box" (2003)(mini-itx.com)
    45comments
  27. Fixing the Portobello Police Station Clock(pointinthecloud.com)
    113comments
  28. The Year of Internal Tools(geocod.io)
    21comments
  29. Hackers influence ChatGPT and Gemini to direct users to scam centers(medium.com/arielsimon)
    40comments
  30. Why 'What's Opera, Doc?' looks like that(animationobsessive.substack.com)
    24comments

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.

53m 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}`;
        }
    });
49m 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