Fireship · @fireship

PWA to Google Play Store with Trusted Web Activities (TWA)

Uploaded February 22, 2019 · Length 7:08

PWA to Google Play Store with Trusted Web Activities (TWA)

Summary

Learn how to package a progressive web app (PWA) as a Google Play Store app using Trusted Web Activities (TWA).

  • trusted web activities
  • pwa to google play store
  • android app development
  • progressive web apps
  • google play store

Transcript preview

The first 2 minutes of the transcript. Select a timestamp to watch that moment on YouTube.

  1. 0:00

    [Music]

  2. 0:07

    over the last couple years progressive

  3. 0:08

    web apps have revolutionized the way we

  4. 0:10

    build products on the web but one of the

  5. 0:11

    biggest limitations is that they're not

  6. 0:13

    discoverable on the app stores

  7. 0:14

    if you want to write your web code once

  8. 0:16

    and then reuse it everywhere you'll most

  9. 0:17

    likely use a framework like ionic to

  10. 0:19

    wrap your code in a web view

  11. 0:20

    but get ready to learn about an

  12. 0:22

    interesting new alternative to this

  13. 0:23

    approach

  14. 0:23

    a trusted web activity if you're new

  15. 0:25

    here like and subscribe and you can grab

  16. 0:27

    the full source code on fire ship i o

  17. 0:29

    and i'm giving away another t-shirt with

  18. 0:30

    this video all you have to do is let me

  19. 0:31

    know what you think about twas in the

  20. 0:33

    comments below

  21. 0:34

    first of all what is a trusted web

  22. 0:36

    activity the short answer

  23. 0:37

    is that it's just a way to run a website

  24. 0:39

    in full screen mode within an android

  25. 0:41

    package

  26. 0:42

    you can already do this today and i'll

  27. 0:43

    show you how to do it step by step in

  28. 0:44

    this video we'll take the existing

  29. 0:46

    fireship io pwa

  30. 0:47

    package it up in android and then deploy

  31. 0:49

    it to the google play store

  32. 0:51

    before we get into that you might be

  33. 0:52

    wondering whether you should build a

  34. 0:53

    hybrid webview app or deploy as a twa

  35. 0:56

    let's start by looking at some of the

  36. 0:58

    advantages of a twa

  37. 0:59

    first of all it's very easy and if you

  38. 1:01

    have an existing pwa you can follow

  39. 1:03

    along with this video and have it on

  40. 1:04

    google play in the next few minutes and

  41. 1:06

    unlike a web view it's not sandboxed so

  42. 1:07

    you have access to all the features of a

  43. 1:09

    pwa this means you can use things like

  44. 1:11

    oauth and local storage without having

  45. 1:13

    to patch in cordova plugins in other

  46. 1:15

    words whatever works in your pwa

  47. 1:16

    currently is going to work just as well

  48. 1:18

    in this native app and your content will

  49. 1:20

    always stay up to date so if you deploy

  50. 1:22

    a new feature to your pwa it will

  51. 1:23

    automatically be reflected in the native

  52. 1:25

    app as well there are also some

  53. 1:26

    drawbacks here as well for example this

  54. 1:28

    is only for google play has nothing to

  55. 1:30

    do with the apple app store

  56. 1:31

    the next drawback is that there isn't a

  57. 1:33

    plug-in ecosystem and you don't have

  58. 1:34

    access to the native device features

  59. 1:36

    so you need to rely 100 on the features

  60. 1:39

    available to pwas

  61. 1:40

    and lastly you need to comply with all

  62. 1:42

    the policies for the google play store

  63. 1:44

    so that could complicate things if you

  64. 1:45

    have a payment system that would

  65. 1:47

    otherwise require in-app purchases

  66. 1:48

    so what's the bottom line here well if

  67. 1:50

    you have a progressive web app and you

  68. 1:52

    just want it packaged so it's

  69. 1:53

    discoverable on the google play store

  70. 1:54

    then a twa is something you should

  71. 1:56

    definitely be looking into

  72. 1:57

    and at this point i'd like to give a

  73. 1:58

    huge shout out to zven budek he has a