Hacker News

New stories

Live mirror
30 storiesupdated just nowView source snapshot
  1. DOJ: Uncle Sam bought forensics software from same Russian operation supplying(theregister.com)
    —discuss
  2. Internationalization (Internationalization) and Localization (L10n)(kashyapsuhas.com)
    —discuss
  3. Why the FBI investigated archbishop sheen during WWII(osvnews.com)
    —discuss
  4. Ask HN: Does spec-driven development still pay off with frontier coding models?
    —discuss
  5. AI is accelerating and amplifying threats: immediate action is necessary(aivd.nl)
    —discuss
  6. Marvel Has Been Wearing a Horror Movie Under That Spandex Since 1962(medium.com/theentertainmentbreakdown)
    —discuss
  7. Show HN: Rig – Open-source cloud desktops for AI agents(github.com/shadowwalker2014)
    —discuss
  8. Russian Cosmism(wikipedia.org)
    —discuss
  9. 'Palantir is a great company', EU defence chief tells Euronews(euronews.com)
    1comments
  10. JEV-Star: Low-Cost StarCraft II Control with Language-Model Planning(github.com/sc2musa)
    —discuss
  11. Run-assert-eval: Find the risk, fix it, prove it(commandline.microsoft.com)
    —discuss
  12. Digital Cash Payoff (2001)(technologyreview.com)
    —discuss
  13. Show HN: DrawCMS – An open-source animated diagramming tool for AI Agents(github.com/drawcms)
    —discuss
  14. Logs you, your AI and cron jobs write to that you can prove weren't altered(freshjots.com)
    —discuss
  15. Show HN: bananabread AI – Find what customers love and want from your products(bb-product-api-docs.web.app)
    —discuss
  16. GoDaddy receives takeover offer from maker of Norton antivirus software(ft.com)
    —discuss
  17. If you don't have the factories, you lose the expertise(lemire.me)
    —discuss
  18. Show HN: Headwire – WireGuard with NAT traversal via Tailscale's magicsock(github.com/brofranks)
    —discuss
  19. Namernut – domain name generator that scores how crowded a name is(namernut.com)
    —discuss
  20. Show HN: MEF LLM Studio(mef-llm-studio.com)
    —discuss
  21. Fragments: September 24(martinfowler.com)
    —discuss
  22. Double-entry bookkeeping and paper and tokens(pokorny.ca)
    —discuss
  23. Pummelvision Back(pummelvision.ai)
    —discuss
  24. Legal and General to Cut 10% of Jobs by Middle of 2027(wsj.com)
    —discuss
  25. Beware Overreliance on Metaphor(evnm.substack.com)
    —discuss
  26. AI Workers' Inquiry 2026(techworkersinquiry.org)
    —discuss
  27. .si domain registrations outpace .ai after Trump's 'Super Intelligence' rename(netcraft.com)
    —discuss
  28. Unmasking "zombie cells" in aging tissue with an AI-powered barcode(news.mit.edu)
    —discuss
  29. Weapons of Mass Decentralization Magazine(worksinprogress.co)
    —discuss
  30. Why Washington Governs by Fiscal Cliff(medium.com/freedomofthought)
    —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}`;
        }
    });
1h 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