Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • interkit-experiments interkit-experiments
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 115
    • Issues 115
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 1
    • Merge requests 1
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Infrastructure Registry
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • interkit
  • interkit-experimentsinterkit-experiments
  • Issues
  • #405

Closed
Open
Created Apr 18, 2023 by Holger Heißmeyer@retaniOwner12 of 19 tasks completed12/19 tasks

push messages on PWA

Now that iOS finally supports them.

Wie bauen wir das in interkit ein? Angeblich funktioniert es genauso wie im Desktop Safari und überall auch.

Oder macht Capacitor das schon?

Bei Test auf iOS ging es nicht. Evtl habe ich es selbst mit dieser Abfrage zerstört:

const isPushNotificationsAvailable = () => {
  return Capacitor.isPluginAvailable('PushNotifications');
}

aber haben wir einen push server?

siehe z.b. https://www.heise.de/blog/Web-Push-und-Badging-in-iOS-16-4-Beta-1-Mega-Update-fuer-Progressive-Web-Apps-7518359.html und https://webkit.org/blog/13878/web-push-for-web-apps-on-ios-and-ipados/

achtung, muss noch evtl als beta feature aktiviert werden:

How to enable Push API While waiting for IOS 16 you can turn on Push API on your iPhone by going to Settings, typing Safari in search, click on Safari, scroll all the way down and go to Advanced and tap on Experimental Features. Now scroll down to where it says "Push API", and enable it by tapping on green switch button to turn it on.

hier eine implementierung von web push: https://dzone.com/articles/pwa-push-notifications-in-javascript-yes-you-can-in-12-steps


  • proof of concept / mwe browser, android, ios
  • build into interkit server
    • api endpoint(s): register, unregister comm via InterkitClient
    • backend: save registration, handle next to FCM push
  • frontend: permission asking browser/ios/android
  • make a testing/debug component:
    • show "yes this is a PWA which can receive push notifications"
      • like, https? css check for standalone? listen for installed event?
      • "interkit server has a registration token for your device"
    • button: send me a test notification
    • unregister button?
  • customize sound etc
  • documentation (general, install (credentials))

  • do not Notify when tab is visible?

  • safari/ios: didnt get/send webpushsubscription, maybe because doesnt ask for permissions? have to do it explicitly?
  • quick test android
  • firefox+chromes linux desktop: "activate" button doesn't do anything
    • notifications seem to arrive for domain (not project), is this the only way? how do others do it?
    • desktop browsers seem weird, disable completely, allow only android/ios?

current WIP

do not Notify when tab is visible?

looks like SW self.addEventListener('push') never fires, so it can't be prevented by BroadcastChannel stuff.
Why is that? Is something missing? Was the SW cookbook out of date?
If this is correct, we'll have to prevent serverside (heartbeat)?
Works on Android13

  • iOS still doesn't work. no idea why. push event in SW doesnt arrive.
  • ignoreable: auto title doesnt work
  • TODO: click on notification does nothing. need to explicitly handle? see https://stackoverflow.com/questions/38713685/how-can-i-initiate-a-pwa-progressive-webapp-open-from-a-click-on-a-push-notifi
Edited Jul 02, 2024 by Jakob Wierzba
Assignee
Assign to
Time tracking