Menu

Colin Devroe

Reverse Engineer. Blogger.

Like? Subscribe.

Testing inconsistent Web Share Target API data with a Progressive Web App

One of the latest things I’ve been working on for Unmark is turning the app into a Progressive Web App (PWA). Among other benefits, this affords Unmark the capability of being a “Web Share Target” on Android. (Sadly, only Android for now)

A Web Share Target is very similar to a feature you likely use every day and may not realize it. When you “Share to” or “Share via” an app (say, Twitter or Facebook or Micro.blog’s iOS app) it automatically picks up the URL, title, etc. from the web page you’re currently on – this is using a similar feature set. For PWA’s, this is called the Web Share Target API.

What happens is that the app you share from sends a small little packet of data to the app or PWA. According to the spec it should be sending three specific items: title, url, and notes.

The issue I’ve been working through is that each app has a different way of sending that data. Some of them exclude one or more of the items and each of them have very different ways of sending “Notes”.

I don’t know why these apps aren’t consistent. I suppose it might be in part because they are handling PWAs the same way they are handling other apps. They are just sending a “chunk” of data and they expect the target app to work through it all.

Today I was noodling how best to set up a test application to install on my Android phone so that I can inspect how these apps share their information. This way I can see exactly what information is being shared how Unmark could work with each of them. And I was going to open source it so that others working on this same issue had something they could use.

But it turns out I don’t need to, the Web Incubator Community Group already has a Web Share Target Test PWA already in place to do this. Just install this app on your Android device’s home screen and “Share To” it.

Thanks to Matt Giuca on the Google Chrome team for pointing me in the right direction. I’m glad this already existed.

Loren Brichter on web apps

K. Q. Dreger interviewed Loren Brichter about his recent sale of Letterpress (my favorite iOS game). The interview is full of little behind-the-scenes tidbits on Letterpress and how it was made and where it is going.

However, when Dreger asks Brichter what he’s been up to and what he will be doing next, I thought his thoughts on web apps was worth noting:

My work for the last few years has been on the web, and honestly, it’s a breath of fresh air. Instant refreshing, surprisingly good debugging / perf tools, intrinsically multi-platform, and most importantly, open.

I find the entire concept of App Review morally questionable despite Apple’s good intentions. So I sleep better at night not being part of that anymore. Sure, the web is messy, and it’s delicate, but it’s important and good and getting better fast.

Wouldn’t be surprised if I never went back.

Strong words from someone who has made a big, big name for himself in iOS development. Welcome to the web Loren, you’ll love it here. I’ll be watching Atebits.