Hacker News

New stories

Live mirror
30 storiesupdated just nowView source snapshot
  1. Marvel Has Been Wearing a Horror Movie Under That Spandex Since 1962(medium.com/theentertainmentbreakdown)
    —discuss
  2. Show HN: Rig – Open-source cloud desktops for AI agents(github.com/shadowwalker2014)
    —discuss
  3. Russian Cosmism(wikipedia.org)
    —discuss
  4. 'Palantir is a great company', EU defence chief tells Euronews(euronews.com)
    1comments
  5. JEV-Star: Low-Cost StarCraft II Control with Language-Model Planning(github.com/sc2musa)
    —discuss
  6. Run-assert-eval: Find the risk, fix it, prove it(commandline.microsoft.com)
    —discuss
  7. Digital Cash Payoff (2001)(technologyreview.com)
    —discuss
  8. Show HN: DrawCMS – An open-source animated diagramming tool for AI Agents(github.com/drawcms)
    —discuss
  9. Logs you, your AI and cron jobs write to that you can prove weren't altered(freshjots.com)
    —discuss
  10. Show HN: bananabread AI – Find what customers love and want from your products(bb-product-api-docs.web.app)
    —discuss
  11. GoDaddy receives takeover offer from maker of Norton antivirus software(ft.com)
    —discuss
  12. If you don't have the factories, you lose the expertise(lemire.me)
    —discuss
  13. Show HN: Headwire – WireGuard with NAT traversal via Tailscale's magicsock(github.com/brofranks)
    —discuss
  14. Namernut – domain name generator that scores how crowded a name is(namernut.com)
    —discuss
  15. Show HN: MEF LLM Studio(mef-llm-studio.com)
    —discuss
  16. Fragments: September 24(martinfowler.com)
    —discuss
  17. Double-entry bookkeeping and paper and tokens(pokorny.ca)
    —discuss
  18. Pummelvision Back(pummelvision.ai)
    —discuss
  19. Legal and General to Cut 10% of Jobs by Middle of 2027(wsj.com)
    —discuss
  20. Beware Overreliance on Metaphor(evnm.substack.com)
    —discuss
  21. AI Workers' Inquiry 2026(techworkersinquiry.org)
    —discuss
  22. .si domain registrations outpace .ai after Trump's 'Super Intelligence' rename(netcraft.com)
    —discuss
  23. Unmasking "zombie cells" in aging tissue with an AI-powered barcode(news.mit.edu)
    —discuss
  24. Weapons of Mass Decentralization Magazine(worksinprogress.co)
    —discuss
  25. Why Washington Governs by Fiscal Cliff(medium.com/freedomofthought)
    —discuss
  26. Forging 1024-bit RSA signatures in nearly SNFS time(iacr.org)
    —discuss
  27. The Chosen People(medium.com/freedomofthought)
    —discuss
  28. Show HN: OpenArcade – open-source software from the VR arcade I ran for 4 years(github.com/aprabh96)
    1comments
  29. Vibe Coded Musical Correspondences(caerjar.github.io)
    —discuss
  30. China's Mind on AI(axios.com)
    —discuss

QR codes that route to the appropriate app store

17 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.

1h 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}`;
        }
    });
57m 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