SlideShare una empresa de Scribd logo
1 de 52
Descargar para leer sin conexión
Cross Platform
Progressive Web
Apps
Simon MacDonald
@macdonst
What is a Progressive
Web App?
“ Progressive Web Apps use modern web
capabilities to deliver an app-like user
experience.
“ They evolve from pages in browser tabs
to immersive, top-level apps, maintaining
the web's low friction at every moment.
“ So they're
just web
pages?
Progressive
Works for every user,
regardless of browser
choice because it's built
with progressive
enhancement as a core
tenet.
Responsive
Fits any form factor:
desktop, mobile, tablet, or
whatever is next.
Connectivity
Independent
Enhanced with service
workers to work offline or
on low-quality networks.
© Google
App Like
Feels like an app, because
the app shell model
separates the application
functionality from
application content.
Content
Safe
Served via HTTPS to
prevent snooping and to
ensure content hasn't been
tampered with
NOT!
Re-engagable
Makes re-engagement easy
through features like push
notifications.
Installable
Allows users to add apps
they find most useful to
their home screen without
the hassle of an app store.
Linkable
Easily share the application
via URL, does not require
complex installation.
Discoverable
Is identifiable as an
"application" thanks to W3C
manifest and service
worker registration scope,
allowing search engines to
find it.
// index.html
<link rel="manifest" href="/manifest.json">
// manifest.json
{
"short_name": "AirHorner",
"name": "Kinlan's AirHorner of Infamy",
"icons": [
{
"src": "launcher-icon-1x.png",
"type": "image/png",
"sizes": "48x48"
},
{
"src": "launcher-icon-2x.png",
"type": "image/png",
"sizes": "96x96"
},
{
"src": "launcher-icon-4x.png",
"type": "image/png",
"sizes": "192x192"
}
],
"start_url": "index.html?launcher=true"
}
It all starts with
<link rel="manifest" href="manifest.json">
"short_name": "PWA Test",
"name": "PWA Test",
"start_url": "index.html",
"display": "standalone",
"background_color": "#fff",
"theme_color": "#2196F3",
"description": "A sample PWA.",
"icons": [
{
"src": "img/logo-192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "img/logo-512.png",
"sizes": "512x512",
"type": "image/png"
}
]
manifest.json
"short_name": "PWA Test",
"name": "PWA Test",
"start_url": "index.html",
"display": "standalone",
"background_color": "#fff",
"theme_color": "#2196F3",
"description": "A sample PWA.",
"icons": [
{
"src": "img/logo-192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "img/logo-512.png",
"sizes": "512x512",
"type": "image/png"
}
]
manifest.json
"short_name": "PWA Test",
"name": "PWA Test",
"start_url": "index.html",
"display": "standalone",
"background_color": "#fff",
"theme_color": "#2196F3",
"description": "A sample PWA.",
"icons": [
{
"src": "img/logo-192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "img/logo-512.png",
"sizes": "512x512",
"type": "image/png"
}
]
manifest.json
"short_name": "PWA Test",
"name": "PWA Test",
"start_url": "index.html",
"display": "standalone",
"background_color": "#fff",
"theme_color": "#2196F3",
"description": "A sample PWA.",
"icons": [
{
"src": "img/logo-192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "img/logo-512.png",
"sizes": "512x512",
"type": "image/png"
}
]
manifest.json
"short_name": "PWA Test",
"name": "PWA Test",
"start_url": "index.html?start=a2hs",
"display": "standalone",
"background_color": "#fff",
"theme_color": "#2196F3",
"description": "A sample PWA.",
"icons": [
{
"src": "img/logo-192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "img/logo-512.png",
"sizes": "512x512",
"type": "image/png"
}
]
"short_name": "PWA Test",
"name": "PWA Test",
"start_url": "index.html",
"display": "standalone",
"background_color": "#fff",
"theme_color": "#2196F3",
"description": "A sample PWA.",
"icons": [
{
"src": "img/logo-192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "img/logo-512.png",
"sizes": "512x512",
"type": "image/png"
}
]
manifest.json
"short_name": "PWA Test",
"name": "PWA Test",
"start_url": "index.html",
"display": "standalone",
"background_color": "#fff",
"theme_color": "#2196F3",
"description": "A sample PWA.",
"icons": [
{
"src": "img/logo-192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "img/logo-512.png",
"sizes": "512x512",
"type": "image/png"
}
]
manifest.json
"short_name": "PWA Test",
"name": "PWA Test",
"start_url": "index.html",
"display": "standalone",
"background_color": "#fff",
"theme_color": "#2196F3",
"description": "A sample PWA.",
"icons": [
{
"src": "img/logo-192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "img/logo-512.png",
"sizes": "512x512",
"type": "image/png"
}
]
manifest.json
"short_name": "PWA Test",
"name": "PWA Test",
"start_url": "index.html",
"display": "standalone",
"background_color": "#fff",
"theme_color": "#2196F3",
"description": "A sample PWA.",
"icons": [
{
"src": "img/logo-192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "img/logo-512.png",
"sizes": "512x512",
"type": "image/png"
}
]
manifest.json
App Shell Architecture
Service Workers
“ A service worker is a script
that your browser runs in the
background, separate from a
web page
Registration
if ('serviceWorker' in navigator) {
window.addEventListener('load', function() {
navigator.serviceWorker.register('/service-worker.js');
});
}
Installation
var CACHE_VERSION = 'v1';
var CACHE_LIST = ['index.html', 'css/main.css', 'js/main.js'];
self.addEventListener('install', function(event) {
event.waitUntil(caches.open(CACHE_VERSION)
.then(function(cache) {
return cache.addAll(CACHE_LIST);
}));
});
Activation
self.addEventListener('activate', function(event) {
console.log("service worker has been activated.");
});
Fetch
self.addEventListener('fetch', function(event) {
console.log('Handling fetch event for ' + event.request.url);
event.respondWith(
caches.match(event.request).then(function(response) {
if (response) {
console.log('Found response in cache:', response);
return response;
}
console.log('No response found in cache. Fetch from network...');
return fetch(event.request);
})
);
});
index.html
"short_name": "PWA Test",
"name": "PWA Test",
"start_url": "index.html",
"display": "standalone",
"background_color": "#fff",
"theme_color": "#2196F3",
"description": "A sample PWA.",
"icons": [
{
"src": "img/logo-192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "img/logo-512.png",
"sizes": "512x512",
"type": "image/png"
}
]
manifest.json
<meta
name="apple-mobile-web-app-title"
content="PWA Test">
index.html
"short_name": "PWA Test",
"name": "PWA Test",
"start_url": "index.html",
"display": "standalone",
"background_color": "#fff",
"theme_color": "#2196F3",
"description": "A sample PWA.",
"icons": [
{
"src": "img/logo-192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "img/logo-512.png",
"sizes": "512x512",
"type": "image/png"
}
]
manifest.json
<meta
name="apple-mobile-web-app-capable"
content="yes">
index.html
"short_name": "PWA Test",
"name": "PWA Test",
"start_url": "index.html",
"display": "standalone",
"background_color": "#fff",
"theme_color": "#2196F3",
"description": "A sample PWA.",
"icons": [
{
"src": "img/logo-192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "img/logo-512.png",
"sizes": "512x512",
"type": "image/png"
}
]
manifest.json
<meta name=
"apple-mobile-web-app-status-bar-style"
content="black">
index.html
"short_name": "PWA Test",
"name": "PWA Test",
"start_url": "index.html",
"display": "standalone",
"background_color": "#fff",
"theme_color": "#2196F3",
"description": "A sample PWA.",
"icons": [
{
"src": "img/logo-192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "img/logo-512.png",
"sizes": "512x512",
"type": "image/png"
}
]
manifest.json
<link
rel="apple-touch-icon"
href="img/icons/apple-touch-icon.png">
index.html
"short_name": "PWA Test",
"name": "PWA Test",
"start_url": "index.html",
"display": "standalone",
"background_color": "#fff",
"theme_color": "#2196F3",
"description": "A sample PWA.",
"icons": [
{
"src": "img/logo-192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "img/logo-512.png",
"sizes": "512x512",
"type": "image/png"
}
]
manifest.json
<link
rel="apple-touch-startup-image"
href="img/Default-Portrait.png">
phonegap-plugin-pwa
phonegap-plugin-
service-worker
cordova plugin add https://github.com/phonegap/phonegap-plugin-service-worker
<preference name="ServiceWorker" value="service-worker.js" />
<preference name="CacheCordovaAssets" value="false" />
cordova create myApp --template=<PATH TO ASSETS>
Create an App from your assets
Add the Service Worker plugin
Modify config.xml
cordova run ios
Run your app
npm install -g cordova
Install the Cordova CLI
You're Awesome
The End
Recommended Reading
(article)
(book)
(video)
(article)
Hey, Hey, Cloud Four is a PWA!
Responsive Web Design
Web Push Notifications
Don’t use iOS meta tags irresponsibly in your
Progressive Web Apps

Más contenido relacionado

La actualidad más candente

Usability in the GeoWeb
Usability in the GeoWebUsability in the GeoWeb
Usability in the GeoWeb
Dave Bouwman
 
Browser Wars Episode 1: The Phantom Menace
Browser Wars Episode 1: The Phantom MenaceBrowser Wars Episode 1: The Phantom Menace
Browser Wars Episode 1: The Phantom Menace
Nicholas Zakas
 

La actualidad más candente (20)

How to Develop a Rich, Native-quality User Experience for Mobile Using Web St...
How to Develop a Rich, Native-quality User Experience for Mobile Using Web St...How to Develop a Rich, Native-quality User Experience for Mobile Using Web St...
How to Develop a Rich, Native-quality User Experience for Mobile Using Web St...
 
Web Components & Polymer 1.0 (Webinale Berlin)
Web Components & Polymer 1.0 (Webinale Berlin)Web Components & Polymer 1.0 (Webinale Berlin)
Web Components & Polymer 1.0 (Webinale Berlin)
 
The web - What it has, what it lacks and where it must go - Istanbul
The web - What it has, what it lacks and where it must go - IstanbulThe web - What it has, what it lacks and where it must go - Istanbul
The web - What it has, what it lacks and where it must go - Istanbul
 
Enough with the JavaScript already!
Enough with the JavaScript already!Enough with the JavaScript already!
Enough with the JavaScript already!
 
JavaScript front end performance optimizations
JavaScript front end performance optimizationsJavaScript front end performance optimizations
JavaScript front end performance optimizations
 
Booting up with polymer
Booting up with polymerBooting up with polymer
Booting up with polymer
 
Progressive Enhancement 2.0 (Conference Agnostic)
Progressive Enhancement 2.0 (Conference Agnostic)Progressive Enhancement 2.0 (Conference Agnostic)
Progressive Enhancement 2.0 (Conference Agnostic)
 
Booting up with polymer
Booting up with polymerBooting up with polymer
Booting up with polymer
 
Oleh Zasadnyy "Progressive Web Apps: line between web and native apps become ...
Oleh Zasadnyy "Progressive Web Apps: line between web and native apps become ...Oleh Zasadnyy "Progressive Web Apps: line between web and native apps become ...
Oleh Zasadnyy "Progressive Web Apps: line between web and native apps become ...
 
Building a Secure App with Google Polymer and Java / Spring
Building a Secure App with Google Polymer and Java / SpringBuilding a Secure App with Google Polymer and Java / Spring
Building a Secure App with Google Polymer and Java / Spring
 
The Art of AngularJS in 2015
The Art of AngularJS in 2015The Art of AngularJS in 2015
The Art of AngularJS in 2015
 
HTML5 and the dawn of rich mobile web applications
HTML5 and the dawn of rich mobile web applicationsHTML5 and the dawn of rich mobile web applications
HTML5 and the dawn of rich mobile web applications
 
Usability in the GeoWeb
Usability in the GeoWebUsability in the GeoWeb
Usability in the GeoWeb
 
Our application got popular and now it breaks
Our application got popular and now it breaksOur application got popular and now it breaks
Our application got popular and now it breaks
 
Develop a vanilla.js spa you and your customers will love
Develop a vanilla.js spa you and your customers will loveDevelop a vanilla.js spa you and your customers will love
Develop a vanilla.js spa you and your customers will love
 
AEM responsive
AEM responsiveAEM responsive
AEM responsive
 
Browser Wars Episode 1: The Phantom Menace
Browser Wars Episode 1: The Phantom MenaceBrowser Wars Episode 1: The Phantom Menace
Browser Wars Episode 1: The Phantom Menace
 
AtlasCamp 2015: Using add-ons to build add-ons
AtlasCamp 2015: Using add-ons to build add-onsAtlasCamp 2015: Using add-ons to build add-ons
AtlasCamp 2015: Using add-ons to build add-ons
 
Web Development for UX Designers
Web Development for UX DesignersWeb Development for UX Designers
Web Development for UX Designers
 
Enough with the javas cript already! de Nicholas Zakas
Enough with the javas cript already! de Nicholas ZakasEnough with the javas cript already! de Nicholas Zakas
Enough with the javas cript already! de Nicholas Zakas
 

Similar a Building Progressive Web Apps for Android and iOS

Cloud Endpoints _Polymer_ Material design by Martin Görner
Cloud Endpoints_Polymer_Material design by Martin GörnerCloud Endpoints_Polymer_Material design by Martin Görner
Cloud Endpoints _Polymer_ Material design by Martin Görner
European Innovation Academy
 
Web APIs & Apps - Mozilla
Web APIs & Apps - MozillaWeb APIs & Apps - Mozilla
Web APIs & Apps - Mozilla
Robert Nyman
 
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)
Igor Bronovskyy
 

Similar a Building Progressive Web Apps for Android and iOS (20)

Building Progressive Web Apps for Windows devices
Building Progressive Web Apps for Windows devicesBuilding Progressive Web Apps for Windows devices
Building Progressive Web Apps for Windows devices
 
Progressive Web Apps - Intro & Learnings
Progressive Web Apps - Intro & LearningsProgressive Web Apps - Intro & Learnings
Progressive Web Apps - Intro & Learnings
 
Progressive Web Apps
Progressive Web AppsProgressive Web Apps
Progressive Web Apps
 
Bruce Lawson: Progressive Web Apps: the future of Apps
Bruce Lawson: Progressive Web Apps: the future of AppsBruce Lawson: Progressive Web Apps: the future of Apps
Bruce Lawson: Progressive Web Apps: the future of Apps
 
Cloud Endpoints _Polymer_ Material design by Martin Görner
Cloud Endpoints_Polymer_Material design by Martin GörnerCloud Endpoints_Polymer_Material design by Martin Görner
Cloud Endpoints _Polymer_ Material design by Martin Görner
 
I Know It Was MEAN, But I Cut the Cord to LAMP Anyway
I Know It Was MEAN, But I Cut the Cord to LAMP AnywayI Know It Was MEAN, But I Cut the Cord to LAMP Anyway
I Know It Was MEAN, But I Cut the Cord to LAMP Anyway
 
Web APIs & Apps - Mozilla
Web APIs & Apps - MozillaWeb APIs & Apps - Mozilla
Web APIs & Apps - Mozilla
 
I Know It Was MEAN, But I Cut the Cord to LAMP Anyway
I Know It Was MEAN, But I Cut the Cord to LAMP AnywayI Know It Was MEAN, But I Cut the Cord to LAMP Anyway
I Know It Was MEAN, But I Cut the Cord to LAMP Anyway
 
Atomic Design con Pattern Lab
Atomic Design con Pattern LabAtomic Design con Pattern Lab
Atomic Design con Pattern Lab
 
Always on! Or not?
Always on! Or not?Always on! Or not?
Always on! Or not?
 
Progressive Web Apps - NPD Meet
Progressive Web Apps - NPD MeetProgressive Web Apps - NPD Meet
Progressive Web Apps - NPD Meet
 
Service workers
Service workersService workers
Service workers
 
Pivorak.javascript.global domination
Pivorak.javascript.global dominationPivorak.javascript.global domination
Pivorak.javascript.global domination
 
Andriy Vandakurov about "Frontend. Global domination"
Andriy Vandakurov about  "Frontend. Global domination" Andriy Vandakurov about  "Frontend. Global domination"
Andriy Vandakurov about "Frontend. Global domination"
 
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)
 
[Serverless Meetup Tokyo #3] Serverless in Azure (Azure Functionsのアップデート、事例、デ...
[Serverless Meetup Tokyo #3] Serverless in Azure (Azure Functionsのアップデート、事例、デ...[Serverless Meetup Tokyo #3] Serverless in Azure (Azure Functionsのアップデート、事例、デ...
[Serverless Meetup Tokyo #3] Serverless in Azure (Azure Functionsのアップデート、事例、デ...
 
Make your PWA feel more like an app
Make your PWA feel more like an appMake your PWA feel more like an app
Make your PWA feel more like an app
 
Pinkoi Mobile Web
Pinkoi Mobile WebPinkoi Mobile Web
Pinkoi Mobile Web
 
Micro app-framework
Micro app-frameworkMicro app-framework
Micro app-framework
 
Micro app-framework - NodeLive Boston
Micro app-framework - NodeLive BostonMicro app-framework - NodeLive Boston
Micro app-framework - NodeLive Boston
 

Más de FITC

Designing for Digital Health
Designing for Digital HealthDesigning for Digital Health
Designing for Digital Health
FITC
 
Profiling JavaScript Performance
Profiling JavaScript PerformanceProfiling JavaScript Performance
Profiling JavaScript Performance
FITC
 
HyperLight Websites
HyperLight WebsitesHyperLight Websites
HyperLight Websites
FITC
 
Everything is Terrifying
Everything is TerrifyingEverything is Terrifying
Everything is Terrifying
FITC
 
Post-Earth Visions: Designing for Space and the Future Human
Post-Earth Visions: Designing for Space and the Future HumanPost-Earth Visions: Designing for Space and the Future Human
Post-Earth Visions: Designing for Space and the Future Human
FITC
 

Más de FITC (20)

Cut it up
Cut it upCut it up
Cut it up
 
Designing for Digital Health
Designing for Digital HealthDesigning for Digital Health
Designing for Digital Health
 
Profiling JavaScript Performance
Profiling JavaScript PerformanceProfiling JavaScript Performance
Profiling JavaScript Performance
 
Surviving Your Tech Stack
Surviving Your Tech StackSurviving Your Tech Stack
Surviving Your Tech Stack
 
How to Pitch Your First AR Project
How to Pitch Your First AR ProjectHow to Pitch Your First AR Project
How to Pitch Your First AR Project
 
Start by Understanding the Problem, Not by Delivering the Answer
Start by Understanding the Problem, Not by Delivering the AnswerStart by Understanding the Problem, Not by Delivering the Answer
Start by Understanding the Problem, Not by Delivering the Answer
 
Cocaine to Carrots: The Art of Telling Someone Else’s Story
Cocaine to Carrots: The Art of Telling Someone Else’s StoryCocaine to Carrots: The Art of Telling Someone Else’s Story
Cocaine to Carrots: The Art of Telling Someone Else’s Story
 
Everyday Innovation
Everyday InnovationEveryday Innovation
Everyday Innovation
 
HyperLight Websites
HyperLight WebsitesHyperLight Websites
HyperLight Websites
 
Everything is Terrifying
Everything is TerrifyingEverything is Terrifying
Everything is Terrifying
 
Post-Earth Visions: Designing for Space and the Future Human
Post-Earth Visions: Designing for Space and the Future HumanPost-Earth Visions: Designing for Space and the Future Human
Post-Earth Visions: Designing for Space and the Future Human
 
The Rise of the Creative Social Influencer (and How to Become One)
The Rise of the Creative Social Influencer (and How to Become One)The Rise of the Creative Social Influencer (and How to Become One)
The Rise of the Creative Social Influencer (and How to Become One)
 
East of the Rockies: Developing an AR Game
East of the Rockies: Developing an AR GameEast of the Rockies: Developing an AR Game
East of the Rockies: Developing an AR Game
 
Creating a Proactive Healthcare System
Creating a Proactive Healthcare SystemCreating a Proactive Healthcare System
Creating a Proactive Healthcare System
 
World Transformation: The Secret Agenda of Product Design
World Transformation: The Secret Agenda of Product DesignWorld Transformation: The Secret Agenda of Product Design
World Transformation: The Secret Agenda of Product Design
 
The Power of Now
The Power of NowThe Power of Now
The Power of Now
 
High Performance PWAs
High Performance PWAsHigh Performance PWAs
High Performance PWAs
 
Rise of the JAMstack
Rise of the JAMstackRise of the JAMstack
Rise of the JAMstack
 
From Closed to Open: A Journey of Self Discovery
From Closed to Open: A Journey of Self DiscoveryFrom Closed to Open: A Journey of Self Discovery
From Closed to Open: A Journey of Self Discovery
 
Projects Ain’t Nobody Got Time For
Projects Ain’t Nobody Got Time ForProjects Ain’t Nobody Got Time For
Projects Ain’t Nobody Got Time For
 

Último

Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider  Progress from Awareness to Implementation.pptxTales from a Passkey Provider  Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
FIDO Alliance
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 

Último (20)

Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
 
Overview of Hyperledger Foundation
Overview of Hyperledger FoundationOverview of Hyperledger Foundation
Overview of Hyperledger Foundation
 
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider  Progress from Awareness to Implementation.pptxTales from a Passkey Provider  Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
 
How to Check CNIC Information Online with Pakdata cf
How to Check CNIC Information Online with Pakdata cfHow to Check CNIC Information Online with Pakdata cf
How to Check CNIC Information Online with Pakdata cf
 
ERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage IntacctERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage Intacct
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsContinuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Simplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptxSimplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptx
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
AI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by AnitarajAI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by Anitaraj
 
2024 May Patch Tuesday
2024 May Patch Tuesday2024 May Patch Tuesday
2024 May Patch Tuesday
 
Intro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptxIntro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptx
 
Working together SRE & Platform Engineering
Working together SRE & Platform EngineeringWorking together SRE & Platform Engineering
Working together SRE & Platform Engineering
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Quantum Leap in Next-Generation Computing
Quantum Leap in Next-Generation ComputingQuantum Leap in Next-Generation Computing
Quantum Leap in Next-Generation Computing
 

Building Progressive Web Apps for Android and iOS

  • 3. What is a Progressive Web App?
  • 4. “ Progressive Web Apps use modern web capabilities to deliver an app-like user experience. “ They evolve from pages in browser tabs to immersive, top-level apps, maintaining the web's low friction at every moment.
  • 5. “ So they're just web pages?
  • 6.
  • 7.
  • 8. Progressive Works for every user, regardless of browser choice because it's built with progressive enhancement as a core tenet.
  • 9. Responsive Fits any form factor: desktop, mobile, tablet, or whatever is next.
  • 10. Connectivity Independent Enhanced with service workers to work offline or on low-quality networks. © Google
  • 11. App Like Feels like an app, because the app shell model separates the application functionality from application content. Content
  • 12. Safe Served via HTTPS to prevent snooping and to ensure content hasn't been tampered with NOT!
  • 13. Re-engagable Makes re-engagement easy through features like push notifications.
  • 14. Installable Allows users to add apps they find most useful to their home screen without the hassle of an app store.
  • 15. Linkable Easily share the application via URL, does not require complex installation.
  • 16. Discoverable Is identifiable as an "application" thanks to W3C manifest and service worker registration scope, allowing search engines to find it. // index.html <link rel="manifest" href="/manifest.json"> // manifest.json { "short_name": "AirHorner", "name": "Kinlan's AirHorner of Infamy", "icons": [ { "src": "launcher-icon-1x.png", "type": "image/png", "sizes": "48x48" }, { "src": "launcher-icon-2x.png", "type": "image/png", "sizes": "96x96" }, { "src": "launcher-icon-4x.png", "type": "image/png", "sizes": "192x192" } ], "start_url": "index.html?launcher=true" }
  • 17. It all starts with <link rel="manifest" href="manifest.json">
  • 18. "short_name": "PWA Test", "name": "PWA Test", "start_url": "index.html", "display": "standalone", "background_color": "#fff", "theme_color": "#2196F3", "description": "A sample PWA.", "icons": [ { "src": "img/logo-192.png", "sizes": "192x192", "type": "image/png" }, { "src": "img/logo-512.png", "sizes": "512x512", "type": "image/png" } ] manifest.json
  • 19. "short_name": "PWA Test", "name": "PWA Test", "start_url": "index.html", "display": "standalone", "background_color": "#fff", "theme_color": "#2196F3", "description": "A sample PWA.", "icons": [ { "src": "img/logo-192.png", "sizes": "192x192", "type": "image/png" }, { "src": "img/logo-512.png", "sizes": "512x512", "type": "image/png" } ] manifest.json
  • 20. "short_name": "PWA Test", "name": "PWA Test", "start_url": "index.html", "display": "standalone", "background_color": "#fff", "theme_color": "#2196F3", "description": "A sample PWA.", "icons": [ { "src": "img/logo-192.png", "sizes": "192x192", "type": "image/png" }, { "src": "img/logo-512.png", "sizes": "512x512", "type": "image/png" } ] manifest.json
  • 21. "short_name": "PWA Test", "name": "PWA Test", "start_url": "index.html", "display": "standalone", "background_color": "#fff", "theme_color": "#2196F3", "description": "A sample PWA.", "icons": [ { "src": "img/logo-192.png", "sizes": "192x192", "type": "image/png" }, { "src": "img/logo-512.png", "sizes": "512x512", "type": "image/png" } ] manifest.json "short_name": "PWA Test", "name": "PWA Test", "start_url": "index.html?start=a2hs", "display": "standalone", "background_color": "#fff", "theme_color": "#2196F3", "description": "A sample PWA.", "icons": [ { "src": "img/logo-192.png", "sizes": "192x192", "type": "image/png" }, { "src": "img/logo-512.png", "sizes": "512x512", "type": "image/png" } ]
  • 22. "short_name": "PWA Test", "name": "PWA Test", "start_url": "index.html", "display": "standalone", "background_color": "#fff", "theme_color": "#2196F3", "description": "A sample PWA.", "icons": [ { "src": "img/logo-192.png", "sizes": "192x192", "type": "image/png" }, { "src": "img/logo-512.png", "sizes": "512x512", "type": "image/png" } ] manifest.json
  • 23. "short_name": "PWA Test", "name": "PWA Test", "start_url": "index.html", "display": "standalone", "background_color": "#fff", "theme_color": "#2196F3", "description": "A sample PWA.", "icons": [ { "src": "img/logo-192.png", "sizes": "192x192", "type": "image/png" }, { "src": "img/logo-512.png", "sizes": "512x512", "type": "image/png" } ] manifest.json
  • 24. "short_name": "PWA Test", "name": "PWA Test", "start_url": "index.html", "display": "standalone", "background_color": "#fff", "theme_color": "#2196F3", "description": "A sample PWA.", "icons": [ { "src": "img/logo-192.png", "sizes": "192x192", "type": "image/png" }, { "src": "img/logo-512.png", "sizes": "512x512", "type": "image/png" } ] manifest.json
  • 25. "short_name": "PWA Test", "name": "PWA Test", "start_url": "index.html", "display": "standalone", "background_color": "#fff", "theme_color": "#2196F3", "description": "A sample PWA.", "icons": [ { "src": "img/logo-192.png", "sizes": "192x192", "type": "image/png" }, { "src": "img/logo-512.png", "sizes": "512x512", "type": "image/png" } ] manifest.json
  • 27.
  • 28.
  • 29.
  • 30. Service Workers “ A service worker is a script that your browser runs in the background, separate from a web page
  • 31. Registration if ('serviceWorker' in navigator) { window.addEventListener('load', function() { navigator.serviceWorker.register('/service-worker.js'); }); }
  • 32. Installation var CACHE_VERSION = 'v1'; var CACHE_LIST = ['index.html', 'css/main.css', 'js/main.js']; self.addEventListener('install', function(event) { event.waitUntil(caches.open(CACHE_VERSION) .then(function(cache) { return cache.addAll(CACHE_LIST); })); });
  • 34. Fetch self.addEventListener('fetch', function(event) { console.log('Handling fetch event for ' + event.request.url); event.respondWith( caches.match(event.request).then(function(response) { if (response) { console.log('Found response in cache:', response); return response; } console.log('No response found in cache. Fetch from network...'); return fetch(event.request); }) ); });
  • 35.
  • 36.
  • 37.
  • 38.
  • 39. index.html "short_name": "PWA Test", "name": "PWA Test", "start_url": "index.html", "display": "standalone", "background_color": "#fff", "theme_color": "#2196F3", "description": "A sample PWA.", "icons": [ { "src": "img/logo-192.png", "sizes": "192x192", "type": "image/png" }, { "src": "img/logo-512.png", "sizes": "512x512", "type": "image/png" } ] manifest.json <meta name="apple-mobile-web-app-title" content="PWA Test">
  • 40. index.html "short_name": "PWA Test", "name": "PWA Test", "start_url": "index.html", "display": "standalone", "background_color": "#fff", "theme_color": "#2196F3", "description": "A sample PWA.", "icons": [ { "src": "img/logo-192.png", "sizes": "192x192", "type": "image/png" }, { "src": "img/logo-512.png", "sizes": "512x512", "type": "image/png" } ] manifest.json <meta name="apple-mobile-web-app-capable" content="yes">
  • 41. index.html "short_name": "PWA Test", "name": "PWA Test", "start_url": "index.html", "display": "standalone", "background_color": "#fff", "theme_color": "#2196F3", "description": "A sample PWA.", "icons": [ { "src": "img/logo-192.png", "sizes": "192x192", "type": "image/png" }, { "src": "img/logo-512.png", "sizes": "512x512", "type": "image/png" } ] manifest.json <meta name= "apple-mobile-web-app-status-bar-style" content="black">
  • 42. index.html "short_name": "PWA Test", "name": "PWA Test", "start_url": "index.html", "display": "standalone", "background_color": "#fff", "theme_color": "#2196F3", "description": "A sample PWA.", "icons": [ { "src": "img/logo-192.png", "sizes": "192x192", "type": "image/png" }, { "src": "img/logo-512.png", "sizes": "512x512", "type": "image/png" } ] manifest.json <link rel="apple-touch-icon" href="img/icons/apple-touch-icon.png">
  • 43. index.html "short_name": "PWA Test", "name": "PWA Test", "start_url": "index.html", "display": "standalone", "background_color": "#fff", "theme_color": "#2196F3", "description": "A sample PWA.", "icons": [ { "src": "img/logo-192.png", "sizes": "192x192", "type": "image/png" }, { "src": "img/logo-512.png", "sizes": "512x512", "type": "image/png" } ] manifest.json <link rel="apple-touch-startup-image" href="img/Default-Portrait.png">
  • 44.
  • 45.
  • 46.
  • 49. cordova plugin add https://github.com/phonegap/phonegap-plugin-service-worker <preference name="ServiceWorker" value="service-worker.js" /> <preference name="CacheCordovaAssets" value="false" /> cordova create myApp --template=<PATH TO ASSETS> Create an App from your assets Add the Service Worker plugin Modify config.xml cordova run ios Run your app npm install -g cordova Install the Cordova CLI
  • 52. Recommended Reading (article) (book) (video) (article) Hey, Hey, Cloud Four is a PWA! Responsive Web Design Web Push Notifications Don’t use iOS meta tags irresponsibly in your Progressive Web Apps