Giter VIP home page Giter VIP logo

pwa's Introduction

Trusted Web Activity Sample

https://developers.google.com/web/updates/2019/02/using-twa

This repository contains both Android app and Web app.

The web app is a very simple ToDo Progressive Web Application with 100 performance scores in Chrome's LightHouse. It uses service worker to be available offline and persists your data in browser's local storage.

The android app is built with a native screen and Chrome's Trusted Web Activity which is available in Chrome 72 and above.

Trusted Web Activity is the compilation of the best parts of WebView and Chrome Custom Tabs. With TWA you can launch web app in your first-party android application without having a URL bar appeared like WebView allows, but run your PWA in up-to-date Chrome browser.

By using service worker (which is required for now) your web app can be loaded once and then be available offline.

To prove your application is trusted you have to put assetlinks.json file to the root of your web application. The association is created via Digital Asset Links and the association must be established in both ways, linking from the app to the website and from the website to the app. There is a assetlinks.json generation tool which allows you generating the file and validating it's presence on the web app server

In order to be accepted by Google Play your PWA has to meet the same requirements as for being added your PWA to the home screen:

  • Includes a web app manifest with the required properties:
    • short_name or name
    • icons must include a 192px and a 512px sized icons
    • start_url
    • display must be one of: fullscreen, standalone, or minimal-ui
  • Served over HTTPS
  • Has registered a service worker with a fetch event handler

Built signed apk can be found here โ€” debug release

Screenshots

Main (native) screen TWA with Digital Asset Link Same PWA opened in Chrome
Unsigned TWA / no Digital Asset Link External link opened

References

https://developers.google.com/web/updates/2019/02/using-twa
https://developers.google.com/web/fundamentals/app-install-banners/#what_are_the_criteria
https://developers.google.com/digital-asset-links/tools/generator

pwa's People

Contributors

antipovandrey avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.