News for hackers. Stuff that matters.
Re:What PWA Can Do Today by bob1029 on Monday January 08, 2024 @10:30AM (#38913349)
We push PWAs to iPads & Surface Go devices via Microsoft InTune for some of our clients today.

This path started out very nightmarish (circa 2020) but it's going much smoother today. One of our customers actually came back to us with a slightly improved process based upon the one we gave them. They switched from iPad to Surface Go and used some extra endpoint management to make the PWA experience into a sort of kiosk mode.

The #1 constraint for us is the quality of the environment-facing camera and the level of access we have to its capabilities via the browser. iOS/Safari started out extremely weak on this but is quite good today. I can get a solid 2k environment scan at 30fps from the rear facing iPad camera in Safari today. Things like 2D barcode scan and document capture are 100% feasible now. These items used to make us extremely nervous on product demos but we don't worry anymore.

We almost capitulated and went back to native iOS apps because of the camera issues, but the pain of maintaining a native build chain when you are otherwise a 100% Microsoft shop (with barely 3 developers) was pushing back hard too. We were signing enterprise IPAs for all of our clients for half a decade before we switched to web/PWA. I will never go back to native apps. I'll find a different career path and hobbies if the web goes away.

I don't have a clean answer for B2C other than... I use HN and Twitter in Safari and I don't even process that it's not a native app. Neither of these web properties had to spend a single second worrying about a native app to acquire my business.

Re:What PWA Can Do Today by thekingshorses on Monday January 08, 2024 @11:17AM (#38914179)
> 2D barcode

Which JS library do you use?

I couldn't find a single library that can reliably scan PDF417 barcodes.

Re:What PWA Can Do Today by bob1029 on Monday January 08, 2024 @12:21PM (#38915158)
https://github.com/zxing-js/library

Media constraints are the #1 reason it won't scan in my experience. You need at least ~1000px horizontal to reliably decode PDF417. If the resolution is 720p or lower, you aren't capturing enough information for a decode.

Re:What PWA Can Do Today by k__ on Monday January 08, 2024 @12:29PM (#38915274)
I tried zxing too.

Scanning 2D barcodes only works reliable on smartphones with good camera and with good lighting.

I needed it for a ticket scanner used on an old phone at night entries for concerts.

Went and bought a hardware scanner (for 30€ or something) that connects itself as a "Bluetooth keyboard". Works like a charm.

Re:What PWA Can Do Today by bob1029 on Monday January 08, 2024 @12:48PM (#38915494)
> Scanning 2D barcodes only works reliable on smartphones

We wont even fully certify iPhones for use with this solution because we have seen consistent failure to autofocus on the barcode for "some weird reason". iPads work like magic though. I have to go out of my way to not get a quick scan on recent generation iPad camera.

We went down the hardware scanning path w/ keyboard emulation in the browser, but its kind of clunky when you are considering the overall solution stack in a B2B setting.

Re:What PWA Can Do Today by ubercore on Monday January 08, 2024 @01:15PM (#38915869)
We've also not had the best luck with keyboard emulation scanners, but unless you want to add a native wrapper, there aren't a ton of good options.
Re:What PWA Can Do Today by k__ on Tuesday January 09, 2024 @06:55AM (#38925068)
Oh how come?
Re:What PWA Can Do Today by dvsk on Monday January 08, 2024 @12:26PM (#38915230)
If you’re open to using a commercial solution then there is a WebSDK offered by Scandit - https://www.scandit.com/products/web-sdk/ - full disclosure, I manage their website, however I thought this maybe of interest.
Re:What PWA Can Do Today by jwr on Tuesday January 09, 2024 @03:26AM (#38923691)
Scandit customer here. Their stuff works well. The only drawbacks are reliance on npm and frequently changing APIs.
Re:What PWA Can Do Today by jr19mi on Monday January 08, 2024 @12:34PM (#38915333)
Full disclosure: I work for Scanbot SDK, but we do offer PDF417 scanning for JS. It's a commercial solution that comes with a not-insignificant price tag, but it might be what you're looking for. You can check out the demo and documentation here: https://scanbot.io/trial/demo-web/barcode-demo/ , https://docs.scanbot.io/barcode-scanner-sdk/web/introduction...
Re:What PWA Can Do Today by martinald on Monday January 08, 2024 @11:22AM (#38914258)
Re:What PWA Can Do Today by JimDabell on Monday January 08, 2024 @11:47AM (#38914680)
This is another Google-authored specification, implemented only by Google, which is not currently a web standard. It’s not just Safari that doesn’t support it; Firefox doesn’t either. It’s a Blink-only API.

> Editors:

> Miguel Casas-Sanchez (Google LLC)

> Reilly Grant (Google LLC)

> Status of this document

> This specification was published by the Web Platform Incubator Community Group. It is not a W3C Standard nor is it on the W3C Standards Track.

— https://wicg.github.io/shape-detection-api/

Re:What PWA Can Do Today by sevenf0ur on Monday January 08, 2024 @11:35AM (#38914502)
Safari doesn't support that API whatsoever so a third party JS library is really your only option. The landscape of open source barcode detection libraries is bleak at the moment.
Re:What PWA Can Do Today by asveikau on Monday January 08, 2024 @12:10PM (#38915009)
Can't you take a C library and compile to JS?
Re:What PWA Can Do Today by cicko on Monday January 08, 2024 @02:12PM (#38916617)
Wasm should also work, no?
Re:What PWA Can Do Today by martinald on Monday January 08, 2024 @11:40AM (#38914564)
That's a shame. Works really well on Android.
Re:What PWA Can Do Today by dannymoerkerke on Monday January 08, 2024 @06:01PM (#38919648)
It does since iOS 17. For now you’ll have to enable it manually through Settings > Safari > Advanced > Feature Flags > Shape Detection API but I expect it to be enabled by default soon.
Re:What PWA Can Do Today by oaiey on Monday January 08, 2024 @01:52PM (#38916370)
As a Microsoft shop: Any experience with Blazor and PWA? I find Blazor very awesome for developing an App using WebAssembly. When using it as a PWA and caching the .NET runtime locally etc, the combination of productivity and ease of deployment could be theoretically really awesome.
Re:What PWA Can Do Today by bob1029 on Monday January 08, 2024 @02:30PM (#38916857)
Yes. Tons with server-side Blazor apps. We currently use Blazor for our internal admin UIs, but at this point I'd never put it in something customer facing (even in B2B setting).

We haven't played with the client-side WASM stuff, but the conclusion is that server-side blazor is not a fantastic technology if you want something that "just works". Websockets in particular are kind of nasty when you have a client device ecosystem where screens and apps are frequently changing activity state. Stateless forms are much easier to reason about. iOS/Safari is very aggressive with closing down unused resources. Stateless forms can survive for days on those user agents. Our blazor apps would require refreshes after a few minutes of inactivity.

Vanilla web forms & SSR is what we run with today. Our "framework" is to use string verbatim & interpolation operators in C# to compose our responses. Looks something like PHP and has zero dependencies.

Re:What PWA Can Do Today by oaiey on Tuesday January 09, 2024 @05:56AM (#38924647)
Yeah, server side blazor is IMHO a bad product. Blazor with wasm on browser or PWA or Blazor with MAUI and a web view (without wasm) is the deal.
Re:What PWA Can Do Today by asabla on Monday January 08, 2024 @02:25PM (#38916794)
Built an application using strictly Blazor wasm for my last assignment (so .Net 7).

It wasn't a easy ride (especially when it comes to LSP support for razor pages). But the overall experience was pretty decent.

Almost half of our users preferred to use the application as a PWA (using windows 10 and edge) instead of an ordinary tab in your browser.

Somethings to consider tho: Upgrades to service workers and what not can be a bit challenging depending on your situation.

Keep in mind that a lot of firewalls and antivituses may block all those binary downloads (since it's just dll files). There are ways around it ofc, but still expect files to be blocked.

Authorization changed between .net 7 and 8. So make sure you understand what these changes are (if you use packages from Microsoft)

Re:What PWA Can Do Today by oaiey on Tuesday January 09, 2024 @05:58AM (#38924654)
Editing in VS Code is really bad right now. It got worse actually.

The dll/firewall should be solved in .NET8 since the browser stack defined a native format (cil I think).

Thanks for the pro tips!!!

Re:What PWA Can Do Today by Kuraj on Monday January 08, 2024 @06:12PM (#38919792)
Personally I am in love with Avalonia UI for client-side because it just feels like WPF/Silverlight done right. I can use all my WPF knowledge to develop cross-platform PWA apps. It's the shit.