Outils pour utilisateurs

Outils du site


informatique:progressive_web_app_pwa

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
Prochaine révision
Révision précédente
informatique:progressive_web_app_pwa [07/07/2025 09:58] – [Push API / WebPush] cyrilleinformatique:progressive_web_app_pwa [12/07/2025 10:53] (Version actuelle) – ↷ Liens modifiés en raison d'un déplacement. 47.128.36.91
Ligne 43: Ligne 43:
       * [[https://github.com/Minishlink/web-push-php-example|Minishlink/web-push-php-example]] a complete example with html+JS frontend and php backend using ''web-push-php''       * [[https://github.com/Minishlink/web-push-php-example|Minishlink/web-push-php-example]] a complete example with html+JS frontend and php backend using ''web-push-php''
       * [[https://github.com/laravel-notification-channels/webpush|Web Push Notifications Channel for Laravel]]        * [[https://github.com/laravel-notification-channels/webpush|Web Push Notifications Channel for Laravel]] 
 +      * https://framagit.org/Cyrille37/webpush-demo/-/tree/main
 +
  
 ===== Online démos ===== ===== Online démos =====
Ligne 55: Ligne 57:
  
  
-mine: [[/app/le_saviez-vous_sur_wikipedia]]+mine: [[app:croustiwiki]]
  
   * App Directories   * App Directories
Ligne 75: Ligne 77:
     * librairie orientée mobile, à essayer absolument ;-)     * librairie orientée mobile, à essayer absolument ;-)
   * [[https://github.com/Minishlink/pwa-qr-code-scanner|pwa-qr-code-scanner]] Lightweight progressive web app for scanning QR codes offline. Par l'auteur de [[https://github.com/web-push-libs/web-push-php|web-push-libs/web-push-php]]   * [[https://github.com/Minishlink/pwa-qr-code-scanner|pwa-qr-code-scanner]] Lightweight progressive web app for scanning QR codes offline. Par l'auteur de [[https://github.com/web-push-libs/web-push-php|web-push-libs/web-push-php]]
 +  * OsmApp https://github.com/zbycz/osmapp/ https://osmapp.org/
 +
  
 ===== Techno ===== ===== Techno =====
Ligne 80: Ligne 84:
 ==== Installation ==== ==== Installation ====
  
-Pour installer un PWA sans passer par une compilation et publication sur un magasin d'application: "installer sur l'écran d'accueil".+Pour installer un PWA sans passer par une compilation et publication sur un magasin d'application: "installer sur l'écran d'accueil" aka [[/glossaire/A2HS|A2HS]].
  
 😩 L'event ''beforeinstallprompt'' n'est pas implémenté par Safari on iOS ni Firefox for Android  -> [[https://developer.mozilla.org/en-US/docs/Web/API/BeforeInstallPromptEvent#browser_compatibility|MDN browser_compatibility]] 😩 L'event ''beforeinstallprompt'' n'est pas implémenté par Safari on iOS ni Firefox for Android  -> [[https://developer.mozilla.org/en-US/docs/Web/API/BeforeInstallPromptEvent#browser_compatibility|MDN browser_compatibility]]
Ligne 149: Ligne 153:
 Voluntary Application Server Identification (VAPID) for Web Push [[rfc>8292]] [[rfc>9749]] Voluntary Application Server Identification (VAPID) for Web Push [[rfc>8292]] [[rfc>9749]]
  
-  * La **page de démo** https://simple-push-demo.vercel.app/ explique bien les différents éléments+  * **page de démo*
 +    * https://simple-push-demo.vercel.app/ explique bien les différents éléments 
 +    * https://tests.peter.sh/notification-generator/#actions=3
   * [[https://pqvst.com/2023/11/21/web-push-notifications/|Demystifying Web Push Notifications]]   * [[https://pqvst.com/2023/11/21/web-push-notifications/|Demystifying Web Push Notifications]]
-  * [[https://developer.apple.com/documentation/usernotifications/sending-web-push-notifications-in-web-apps-and-browsers|Sending web push notifications in web apps and browsers]] by Apple 
  
   * Mozilla / Firefox   * Mozilla / Firefox
Ligne 160: Ligne 165:
     * [[https://developer.apple.com/documentation/usernotifications/sending-web-push-notifications-in-web-apps-and-browsers|Sending web push notifications in web apps and browsers]] (developer.apple.com)     * [[https://developer.apple.com/documentation/usernotifications/sending-web-push-notifications-in-web-apps-and-browsers|Sending web push notifications in web apps and browsers]] (developer.apple.com)
     * [[https://developer.apple.com/documentation/usernotifications/setting-up-a-remote-notification-server|Setting up a remote notification server]]     * [[https://developer.apple.com/documentation/usernotifications/setting-up-a-remote-notification-server|Setting up a remote notification server]]
 +    * Les notifs fonctionnent très bien (après A2HS), même mieux qu'avec Chrome ou Firefox car elles apparaissent sur l'écran vérouillé. Par contre Webkit (Safari) nettoie automatiquement toutes les données d'un site non visité depuis "//un certain temps//", dont le ServiceWorker qui se voit supprimé. Voir [[https://webkit.org/blog/16535/meet-declarative-web-push/|Meet Declarative Web Push]] qui rappelle le fonctionnement de l'ITP (Intelligent Tracking Prevention) de Webkit.
 +
  
 Voir chapitre "[[#tools]]" pour la mise en œuvre. Voir chapitre "[[#tools]]" pour la mise en œuvre.
  
-Apple: un ''POST'' d'envoi de message sur https://web.push.apple.comdonne un ''403 Forbidden'' avec le même code que pour Google et Mozilla 😤+=== BadJwtToken === 
 + 
 +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 [[https://developer.apple.com/documentation/usernotifications/sending-web-push-notifications-in-web-apps-and-browsers|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''
 +     
 +https://github.com/web-push-libs/web-push-php/issues/398 
 + 
 +=== stale/invalid subscriptions ===
  
 +  * [[https://pushpad.xyz/blog/fcm-returns-404-for-stale-push-subscriptions|Google is removing the inactive and unreachable push subscriptions]] (2024-06)
  
 ==== WebAuthn ==== ==== WebAuthn ====
informatique/progressive_web_app_pwa.1751875098.txt.gz · Dernière modification : de cyrille

Sauf mention contraire, le contenu de ce wiki est placé sous les termes de la licence suivante : CC0 1.0 Universal
CC0 1.0 Universal Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki