Articles:
web-push-phpmine: croustiwiki
Pour installer un PWA sans passer par une compilation et publication sur un magasin d'application: “installer sur l'écran d'accueil” aka A2HS.
😩 L'event beforeinstallprompt n'est pas implémenté par Safari on iOS ni Firefox for Android → MDN browser_compatibility
Sans beforeinstallprompt il faut expliquer selon, la plateforme, comment Ajouter à l'écran d'accueil (Add to Home Screen aka A2HS)
Apple:
Doc:
Is your app installed?
Tools & libraries :
L’implémentation Push API utilise un service tiers configuré et fourni gratuitement par l'éditeur du navigateur.
https://jmt17.google.com/fcm Firebase Cloud Messaging (FCM), anciennement appelé Google Cloud Messaging (GCM) docuVoluntary Application Server Identification (VAPID) for Web Push 8292 9749
Voir chapitre “tools” pour la mise en œuvre.
Apple: un POST d'envoi de message sur web.push.apple.com donne un 403 Forbidden et reason:BadJwtToken avec le même code 😤 que pour Google et Mozilla qui eux fonctionnent.
Après lecture attentive de Sending web push notifications in web apps and browsers :
BadJwtToken
The JSON web token (JWT) has one of following issues: The JWT is missing. The JWT is signed with the wrong private key. The JWT subject claim isn’t a URL or mailto:. The JWT audience claim isn’t the origin of the push service where you sent the request. The JWT expiration parameter is more than one day into the future.
note: Apple seems to refuse url if it's TLD does not exists : it works with https://pouet.world but fail with https://code.devhost.
Web Authentication API (WebAuthn)
La démo WebAuthn fonctionne sur Android + Firefox, après avoir autorisé les Services Google Play à accéder aux fichiers (Storage). Thanks to Danny Moerkerke.
Android+Firefox : WebAuthn fonctionne sans besoin d'installer la page sur l'écran d'accueil de l'appareil.
This API should not be confused with the Web Share Target API.
Propriétés de partage (aka Share Data) :
url est relative à window.location. Si on code url=“@todo” dans le partage ça donne https://tools.comptoir.net/wpduk/@todoAprès tous les exemples rencontrés, la méthode d'inscription du ServiceWorker la plus aboutie: sw-registration.js de DannyMoerkerke (again! of course!) accompagné de son service-worker.js.
Le débugueur de Chrome/Chromium est plus pratique, mais il n'aime pas le certificat sans autorité reconnue (self-signed).
chromium \ --ignore-certificate-errors \ --unsafely-treat-insecure-origin-as-secure=https://code.devhost/ \ https://code.devhost/dev/wikipedia-did-you-know/wikipedia-did-you-know.pwa/
Pour Firefox il faut lancer un autre outil avec Ctrl + Shift + J et sélectionner “multi-processus”.
Avec le widget inapp_webview.