progressive web apps: das ende der app - stores oder über ... · • great way to extend current...

42
Progressive Web Apps: Das Ende der App- Stores oder über-hyptes Buzzword- Bingo? Karlsruher Entwicklertag 2018 Steffen Jahr @steffenjahr [email protected]

Upload: others

Post on 20-May-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Progressive Web Apps: Das Ende der App - Stores oder über ... · • Great way to extend current web applications • Progressive Web Apps can be built for Android devices • Apple

Progressive Web Apps: Das Ende der App-Stores oder über-hyptes Buzzword-Bingo?

Karlsruher Entwicklertag 2018

Steffen [email protected]@thinktecture.com

Page 2: Progressive Web Apps: Das Ende der App - Stores oder über ... · • Great way to extend current web applications • Progressive Web Apps can be built for Android devices • Apple

Karlsruher Entwicklertag 2018Progressive Web Apps

Who is speaking?Steffen Jahr

Software Developer @ Thinktecture AG

! [email protected]

" @steffenjahr

# https://steffenjahr.de

Page 3: Progressive Web Apps: Das Ende der App - Stores oder über ... · • Great way to extend current web applications • Progressive Web Apps can be built for Android devices • Apple

• Native development

• One programming language per platform• Android: Java• iOS: Objective-C• Windows Mobile/Phone: C#

Progressive Web AppsKarlsruher Entwicklertag 2018

App development at the beginning

(Source: https://www.ifixit.com/Device/iPhone_1st_Generation)

Page 4: Progressive Web Apps: Das Ende der App - Stores oder über ... · • Great way to extend current web applications • Progressive Web Apps can be built for Android devices • Apple

• Cross Platform Development• Cordova, Ionic, …

• HTML5, JavaScript & CSS3

• Write once, run anywhere!

Progressive Web AppsKarlsruher Entwicklertag 2018

App development today

(Source: http://view.ionic.io/phones.png)

Page 5: Progressive Web Apps: Das Ende der App - Stores oder über ... · • Great way to extend current web applications • Progressive Web Apps can be built for Android devices • Apple

What’s next?

Progressive Web AppsKarlsruher Entwicklertag 2018

App development in the future

?

Page 6: Progressive Web Apps: Das Ende der App - Stores oder über ... · • Great way to extend current web applications • Progressive Web Apps can be built for Android devices • Apple

• ~700k Apps in Windows Store (phones and tablets included)

• ~30k Apps in Mac App Store

• Primary: Native development • C#• Swift• Objective-C

• Alternative: Electron application• HTML5• CCS3• JavaScript

Progressive Web AppsKarlsruher Entwicklertag 2018

Wait! What about desktop?

Page 7: Progressive Web Apps: Das Ende der App - Stores oder über ... · • Great way to extend current web applications • Progressive Web Apps can be built for Android devices • Apple

• No difference between website or app

• Apps can be installed directly from browser• No app stores anymore!

• One programming language for all platforms

• Access to native device resources

Progressive Web AppsKarlsruher Entwicklertag 2018

What about the future?

Page 8: Progressive Web Apps: Das Ende der App - Stores oder über ... · • Great way to extend current web applications • Progressive Web Apps can be built for Android devices • Apple

The answer!

• Defined by Google in 2015

• No new technology to develop applications

• No new programming language needed

• Describes a type of applications

• Installable

• Offline

• Push Notifications

• And much more…

Progressive Web AppsKarlsruher Entwicklertag 2018

Progressive Web Apps

Page 9: Progressive Web Apps: Das Ende der App - Stores oder über ... · • Great way to extend current web applications • Progressive Web Apps can be built for Android devices • Apple

Responsive Linkable Discoverable Installable

App-like Connectivity Independent Fresh Safe

Re-engageable Progressive

“Uber Pattern”

Karlsruher Entwicklertag 2018Progressive Web Apps

http

s://d

evel

oper

s.goo

gle.

com

/web

/fun

dam

enta

ls/ge

ttin

g-st

arte

d/co

dela

bs/y

our-

first

-pw

app/

Page 10: Progressive Web Apps: Das Ende der App - Stores oder über ... · • Great way to extend current web applications • Progressive Web Apps can be built for Android devices • Apple

Progressive Web AppsKarlsruher Entwicklertag 2018

How can this be achieved?

?

Page 11: Progressive Web Apps: Das Ende der App - Stores oder über ... · • Great way to extend current web applications • Progressive Web Apps can be built for Android devices • Apple

Progressive Web Apps

HTML5, JavaScript, CSS3

Service Worker API

Fetch API Web Notifications Web Workers Push API

Web App Manifest HTTPS

PWA Technology Overview

Karlsruher Entwicklertag 2018Progressive Web Apps

Page 12: Progressive Web Apps: Das Ende der App - Stores oder über ... · • Great way to extend current web applications • Progressive Web Apps can be built for Android devices • Apple

• Background tasks

• Lives in its own JavaScript file

• Has its own thread to prevent UI blocking

• No DOM manipulation

• Can communicate with the application

• Proxy between app and network

• Have to be installed

• Available: https://jakearchibald.github.io/isserviceworkerready/

Progressive Web AppsKarlsruher Entwicklertag 2018

Service Worker

Page 13: Progressive Web Apps: Das Ende der App - Stores oder über ... · • Great way to extend current web applications • Progressive Web Apps can be built for Android devices • Apple

Responsive Linkable Discoverable Installable

App-like Connectivity Independent Fresh Safe

Re-engageable Progressive

PWA Features

Karlsruher Entwicklertag 2018Progressive Web Apps

http

s://d

evel

oper

s.goo

gle.

com

/web

/fun

dam

enta

ls/ge

ttin

g-st

arte

d/co

dela

bs/y

our-

first

-pw

app/

Page 14: Progressive Web Apps: Das Ende der App - Stores oder über ... · • Great way to extend current web applications • Progressive Web Apps can be built for Android devices • Apple

• One layout for all devices• Phone • Tablet• Desktop

• Layout reacts on resizing

• Implementation with CSS3 Media Queries or CSS frameworks (that use Media Queries)• Media Queries: https://github.com/eduardoboucas/include-media• Bootstrap• Foundation• Material

Progressive Web AppsKarlsruher Entwicklertag 2018

Responsive

Page 15: Progressive Web Apps: Das Ende der App - Stores oder über ... · • Great way to extend current web applications • Progressive Web Apps can be built for Android devices • Apple

Responsive Linkable Discoverable Installable

App-like Connectivity Independent Fresh Safe

Re-engageable Progressive

PWA Features

Karlsruher Entwicklertag 2018Progressive Web Apps

http

s://d

evel

oper

s.goo

gle.

com

/web

/fun

dam

enta

ls/ge

ttin

g-st

arte

d/co

dela

bs/y

our-

first

-pw

app/

Page 16: Progressive Web Apps: Das Ende der App - Stores oder über ... · • Great way to extend current web applications • Progressive Web Apps can be built for Android devices • Apple

• App is linkable because it is a web application

• State of the application is controlled by URL• https://fancy-pwa-application.com/#/features

• Very complex to implement in conventional desktop applications

Progressive Web AppsKarlsruher Entwicklertag 2018

Linkable

Page 17: Progressive Web Apps: Das Ende der App - Stores oder über ... · • Great way to extend current web applications • Progressive Web Apps can be built for Android devices • Apple

Responsive Linkable Discoverable Installable

App-like Connectivity Independent Fresh Safe

Re-engageable Progressive

PWA Features

Karlsruher Entwicklertag 2018Progressive Web Apps

http

s://d

evel

oper

s.goo

gle.

com

/web

/fun

dam

enta

ls/ge

ttin

g-st

arte

d/co

dela

bs/y

our-

first

-pw

app/

Page 18: Progressive Web Apps: Das Ende der App - Stores oder über ... · • Great way to extend current web applications • Progressive Web Apps can be built for Android devices • Apple

• How to differ between a website and a Progressive Web App

• Idea: Define Metadata for the application

• Solution: Manifest.json• Requirement for more Progressive Web App features

• Linked in index.html

• Search machines can differ between website and app

• Microsoft integrates PWAs in their App Store• Auto indexing is in beta state

Progressive Web AppsKarlsruher Entwicklertag 2018

Discoverable

Page 19: Progressive Web Apps: Das Ende der App - Stores oder über ... · • Great way to extend current web applications • Progressive Web Apps can be built for Android devices • Apple

manifest.json

{"short_name": "PWA Demo","name": ”Karlsruher Entwicklertag 2018","icons": [{"src": "assets/icon-144x144.png","sizes": "144x144","type": "image/png"

}],"start_url": "/index.html","display": "standalone"

}

Web App Manifest

Title

Icons

Start URL

Display Type Splash Screen

Additional Config

Description

Related Apps

Karlsruher Entwicklertag 2018Progressive Web Apps

Page 20: Progressive Web Apps: Das Ende der App - Stores oder über ... · • Great way to extend current web applications • Progressive Web Apps can be built for Android devices • Apple

Responsive Linkable Discoverable Installable

App-like Connectivity Independent Fresh Safe

Re-engageable Progressive

PWA Features

Karlsruher Entwicklertag 2018Progressive Web Apps

http

s://d

evel

oper

s.goo

gle.

com

/web

/fun

dam

enta

ls/ge

ttin

g-st

arte

d/co

dela

bs/y

our-

first

-pw

app/

Page 21: Progressive Web Apps: Das Ende der App - Stores oder über ... · • Great way to extend current web applications • Progressive Web Apps can be built for Android devices • Apple

• Installable without App Store

• Browser shows banner to install• Needs information in Manifest.json

• Icon (144x144)• Name

• User has visited site at least twice, with at least five minutes between visits• Future: Shows only if developer triggers it in BeforeInstallPromptEvent

Progressive Web AppsKarlsruher Entwicklertag 2018

Installable

Page 22: Progressive Web Apps: Das Ende der App - Stores oder über ... · • Great way to extend current web applications • Progressive Web Apps can be built for Android devices • Apple

Responsive Linkable Discoverable Installable

App-like Connectivity Independent Fresh Safe

Re-engageable Progressive

PWA Features

Karlsruher Entwicklertag 2018Progressive Web Apps

http

s://d

evel

oper

s.goo

gle.

com

/web

/fun

dam

enta

ls/ge

ttin

g-st

arte

d/co

dela

bs/y

our-

first

-pw

app/

Page 23: Progressive Web Apps: Das Ende der App - Stores oder über ... · • Great way to extend current web applications • Progressive Web Apps can be built for Android devices • Apple

• Usage of native APIs • Audio• Camera• Storage• Location

• No reload on site navigation• Single Page Application Frameworks like Angular, React, …

• Usage of app shell• Fast loading time• Dynamic content

Progressive Web AppsKarlsruher Entwicklertag 2018

App-Like

Page 24: Progressive Web Apps: Das Ende der App - Stores oder über ... · • Great way to extend current web applications • Progressive Web Apps can be built for Android devices • Apple

Responsive Linkable Discoverable Installable

App-like Connectivity Independent Fresh Safe

Re-engageable Progressive

PWA Features

Karlsruher Entwicklertag 2018Progressive Web Apps

http

s://d

evel

oper

s.goo

gle.

com

/web

/fun

dam

enta

ls/ge

ttin

g-st

arte

d/co

dela

bs/y

our-

first

-pw

app/

Page 25: Progressive Web Apps: Das Ende der App - Stores oder über ... · • Great way to extend current web applications • Progressive Web Apps can be built for Android devices • Apple

• App is available offline

• Difference between app and data

• App can be cached in Cache Storage through Service Worker

• Data should be cached in a local storage (LocalStorage, IndexedDB)

• Development: Offline first

Progressive Web AppsKarlsruher Entwicklertag 2018

Connectivity Independent

Page 26: Progressive Web Apps: Das Ende der App - Stores oder über ... · • Great way to extend current web applications • Progressive Web Apps can be built for Android devices • Apple

Responsive Linkable Discoverable Installable

App-like Connectivity Independent Fresh Safe

Re-engageable Progressive

PWA Features

Karlsruher Entwicklertag 2018Progressive Web Apps

http

s://d

evel

oper

s.goo

gle.

com

/web

/fun

dam

enta

ls/ge

ttin

g-st

arte

d/co

dela

bs/y

our-

first

-pw

app/

Page 27: Progressive Web Apps: Das Ende der App - Stores oder über ... · • Great way to extend current web applications • Progressive Web Apps can be built for Android devices • Apple

• Service Worker is always up-to-date• Caches will be refreshed during update

• Respects max-age of the Service Worker script

• Service Worker will be reloaded every 24h at least

Progressive Web AppsKarlsruher Entwicklertag 2018

Fresh

Page 28: Progressive Web Apps: Das Ende der App - Stores oder über ... · • Great way to extend current web applications • Progressive Web Apps can be built for Android devices • Apple

Responsive Linkable Discoverable Installable

App-like Connectivity Independent Fresh Safe

Re-engageable Progressive

PWA Features

Karlsruher Entwicklertag 2018Progressive Web Apps

http

s://d

evel

oper

s.goo

gle.

com

/web

/fun

dam

enta

ls/ge

ttin

g-st

arte

d/co

dela

bs/y

our-

first

-pw

app/

Page 29: Progressive Web Apps: Das Ende der App - Stores oder über ... · • Great way to extend current web applications • Progressive Web Apps can be built for Android devices • Apple

Security first!

• Progressive Web Apps require HTTPS

• Only localhost is allowed for development

• Security is very important because of Service Worker power• Service Worker can affect the application• Service Worker has access to network traffic

Progressive Web AppsKarlsruher Entwicklertag 2018

Safe

Page 30: Progressive Web Apps: Das Ende der App - Stores oder über ... · • Great way to extend current web applications • Progressive Web Apps can be built for Android devices • Apple

Responsive Linkable Discoverable Installable

App-like Connectivity Independent Fresh Safe

Re-engageable Progressive

PWA Features

Karlsruher Entwicklertag 2018Progressive Web Apps

http

s://d

evel

oper

s.goo

gle.

com

/web

/fun

dam

enta

ls/ge

ttin

g-st

arte

d/co

dela

bs/y

our-

first

-pw

app/

Page 31: Progressive Web Apps: Das Ende der App - Stores oder über ... · • Great way to extend current web applications • Progressive Web Apps can be built for Android devices • Apple

Please come back

• Bring back users to the application

• Progressive Web Apps can use notifications• Look like native app notifications• Also notifications on desktop

• App needs authorization for notifications

Progressive Web AppsKarlsruher Entwicklertag 2018

Re-engageable

Page 32: Progressive Web Apps: Das Ende der App - Stores oder über ... · • Great way to extend current web applications • Progressive Web Apps can be built for Android devices • Apple

Push API

• Service Worker can receive push data from the server

• Supported by:• Google Chrome• Mozilla Firefox• Microsoft Edge

• Every Browser has its own Push Service• Chrome: Firebase Cloud Messaging• Firefox: Mozilla Push Service• Microsoft: Microsoft Push Service

• Push messages only can be received from this Push services (yet)

• API can use Web Push protocol to send notifications

Progressive Web AppsKarlsruher Entwicklertag 2018

Re-engageable

Page 33: Progressive Web Apps: Das Ende der App - Stores oder über ... · • Great way to extend current web applications • Progressive Web Apps can be built for Android devices • Apple

Responsive Linkable Discoverable Installable

App-like Connectivity Independent Fresh Safe

Re-engageable Progressive

PWA Features

Karlsruher Entwicklertag 2018Progressive Web Apps

http

s://d

evel

oper

s.goo

gle.

com

/web

/fun

dam

enta

ls/ge

ttin

g-st

arte

d/co

dela

bs/y

our-

first

-pw

app/

Page 34: Progressive Web Apps: Das Ende der App - Stores oder über ... · • Great way to extend current web applications • Progressive Web Apps can be built for Android devices • Apple

• Developing gradually

• Features depending on browser support

• Check for feature support: https://caniuse.com

• Browser with the best support: Google Chrome

• Restricted Service Worker support (yet): Edge, Safari

Progressive Web AppsKarlsruher Entwicklertag 2018

Progressive

Page 35: Progressive Web Apps: Das Ende der App - Stores oder über ... · • Great way to extend current web applications • Progressive Web Apps can be built for Android devices • Apple

• Web Share API• Share data with other applications• Only available in Chrome Beta for Android

• Web Share Target API• Make your application a share target

• Payment Request API• Start payment request• Only available in Edge and Chrome for Android

• Web Bluetooth API• Interact with bluetooth devices• Only available in Chrome

Progressive Web AppsKarlsruher Entwicklertag 2018

The Power of the Modern Web

Page 36: Progressive Web Apps: Das Ende der App - Stores oder über ... · • Great way to extend current web applications • Progressive Web Apps can be built for Android devices • Apple

Workbox

§ Tool to create Service Worker

§ Provides common caching strategies for Service Worker

§ Also provides offline analytics (based on Google Analytics)

§ Available for different build tools

§ https://workboxjs.org/

Progressive Web AppsKarlsruher Entwicklertag 2018

Tools

Page 37: Progressive Web Apps: Das Ende der App - Stores oder über ... · • Great way to extend current web applications • Progressive Web Apps can be built for Android devices • Apple

Lighthouse

• Tool from Google

• Chrome-Extension or Node module

• Checks different indicators if your app works like a Progressive Web App

• Service Worker• Performance• App-Like• HTTPS

Progressive Web AppsKarlsruher Entwicklertag 2018

Tools

Page 38: Progressive Web Apps: Das Ende der App - Stores oder über ... · • Great way to extend current web applications • Progressive Web Apps can be built for Android devices • Apple

• Progressive Web Apps can be the future

• Depends on support of browser companies• Apple has just started to implement the Service Worker

• Payment has to be solved• No App Stores === No payment• Payment Request API can be the right way

• Google and Microsoft are pushing hard!

• New APIs are coming

Progressive Web AppsKarlsruher Entwicklertag 2018

A glance across the border

Page 39: Progressive Web Apps: Das Ende der App - Stores oder über ... · • Great way to extend current web applications • Progressive Web Apps can be built for Android devices • Apple

Demo

Progressive Web AppsKarlsruher Entwicklertag 2018

Page 40: Progressive Web Apps: Das Ende der App - Stores oder über ... · • Great way to extend current web applications • Progressive Web Apps can be built for Android devices • Apple

A real world application

• Twitter Lite (introduced April 2017)

• Push Notifications

• Responsive

• Offline

• Safe

• Automatic Updates

• https://lite.twitter.com/

Progressive Web AppsKarlsruher Entwicklertag 2018

Progressive Web Apps

(Source: https://lite.twitter.com/)

Page 41: Progressive Web Apps: Das Ende der App - Stores oder über ... · • Great way to extend current web applications • Progressive Web Apps can be built for Android devices • Apple

• Livin’ On The Edge• Browser support is not optimal• But it is growing fast!!!

• PWA may be the future of applications

• Great way to extend current web applications

• Progressive Web Apps can be built for Android devices• Apple is forced to act because of Androids overwhelming market share

Progressive Web AppsKarlsruher Entwicklertag 2018

Summary

Page 42: Progressive Web Apps: Das Ende der App - Stores oder über ... · • Great way to extend current web applications • Progressive Web Apps can be built for Android devices • Apple

Thank you! Questions?

[email protected]@thinktecture.comhttps://steffenjahr.de