PWA Becomes TWA and Enters Play Store
Written by Ian Elliot   
Thursday, 07 February 2019

If you just got used to PWA becoming the latest buzz word, Google just invented TWA and allowed these web apps into the Play store. Is this the future?

Progressive Web Apps promise to make web apps less dependent on the web. I've never been sure that Progressive was the right term to use, but now we have another candidate. Google wants to call them Trusted Web Activities, TWAs. A TWA is essentially a PWA with some extra security. You can create one using JavaScript and HTML and, of course, to make offline use possible you need a service worker.

PWAbuilder

A TWA can run full screen in Android Chrome. It can also run in WebView inside an Android app. Because of their extra requirements, TWAs only work in Android KitKat or newer and require an up-to-date installation of Chrome.  If you run the app under Chrome you can customize the way it looks as a Custom Chrome Tab - another Chrome proprietary feature. If you choose to run in a WebView then there are limitations - notably you can't use web push notifications and background sync. You also cannot extract information from the TWA to the enclosing app. The only interaction is passing in a query string when it is first opened.

There is also the small matter that running under Chrome means that you can gain access to shared state with the website that the TWA is associated with. All-in-all running under Chrome seems the best option.

At the moment creating a TWA and getting it into the Play store isn't entirely straightforward.

The blog post states that:

All content in TWAs must comply with Play store policy including policies for payments in-app purchases and other digital goods.

App users expect a great experience on their device. To ensure the quality of experience TWAs must meet PWA installability criteria and load fast. Loading speed is measured using Lighthouse and web content in TWAs must achieve a performance score of 80. Lighthouse is an open-source, automated tool for auditing performance & progressive web apps and is useful both as a benchmark and to help you build better websites.
As with any Play app, additional quality criteria may apply in the future. Apps which fail to meet TWA quality requirements or Play store policy may be denied entry or delisted.

So no presure there then...

So are TWAs the way to go?

The big problem is that PWAs and TWAs still run under the browser sandbox and this means they cannot access the native API - for this you still need something like Cordova or Flutter. If your app is mainly web-oriented this may be a limitation you can live with. A bigger problem is that a PWA is cross platform a TWA on the other hand is Chrome. True the differences are small and you can make your TWA available as a PWA for Firefox, say, but it is regrettable that something that could be totally cross-platform isn't. There is also the matter that TWAs are accessed via the Play store with the usual 30% going to the Play store. Perhaps it is worth it or perhaps not.

pwa2

More Information

Introducing a Trusted Web Activity for Android

Related Articles

Progressive Web Apps Do Seem To Be The Next Big Thing

Google Starts Its Push To Progressive Web Apps - Bye Bye Chrome Apps

JavaScript Async - The Fetch API

All A Flutter - Google's Cross Platform App Framework Ready To Go

To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on Twitter, Facebook or Linkedin.

 

Banner


The Art Of Computer Programming - A Great Present
15/12/2024

If you are looking for a programmer present this holiday season, there is one book, or set of books, that should be top of any list... Donald Knuth's The Art of Computer Programming.



GitHub Announces Open Source Security Fund
03/12/2024

A new security-focused program, the GitHub Secure Open Source Fund, will invest $1.25M across 125 open source projects. The project is backed by the support of organizations including American Express [ ... ]


More News

espbook

 

Comments




or email your comment to: comments@i-programmer.info

<ASIN:1871962560>

<ASIN:1871962579>

 <ASIN:1871962528>

<ASIN:1871962501>

 

 

 

Last Updated ( Wednesday, 02 October 2019 )