service workers
TRANSCRIPT
Les Service Workers
Mathieu Le Bihan @slek22
Application Cache
Et quand la webapp est fermée ?
Des coquilles natives ?
Cobalt Cordova
Service Worker
Standardisation
Cycle de vie
Squelette d’un Service Worker
Enregistrement
Installation
Installation non bloquante
Fetch
Hello World
Répondre avec le réseau
Répondre avec le cache
Fallback
Aller plus loin…
Aller plus loin…
Mise à jour
Mise à jour
Message worker -> clients
Message client -> worker
Push
Push
Push
Ne reste plus qu’à faire un POST sur l’endpoint préalablement sauvegardé :
Un peu plus spécifique pour GCM
https://android.googleapis.com/gcm/send/f-O0cl-8RE4:APA91bER2 … 23k-l0OAS0Ben04GZz1
Endpoint RegisrationID
https://pok3me.firebaseapp.com/
Debugging
about:serviceworkers
chrome://inspect/#service-workerschrome://serviceworker-internals
Background Synchronisation
→ chrome://flags/#enable-experimental-web-platform-features
https://www.youtube.com/v/l4e_LFozK2k
Ce n’est qu’un début !• Periodic Synchronisation• Geofencing• ...
Can I use it ?
Liens utiles - https://serviceworke.rs- https://jakearchibald.com- https://jakearchibald.github.io/isserviceworkerrea
dy/- https://miguelmota.com/blog/getting-started-with
-service-workers/- http://alistapart.com/article/application-cache-is-
a-douchebag
CréditsIcônes :
●https://thenounproject.com/term/sd-card/6185/●https://thenounproject.com/term/network/12676/●https://thenounproject.com/term/cpu/72043/●https://thenounproject.com/term/code/17547/
Merci