[DigitalPoint] PWA

[DigitalPoint] PWA 1.2.5

No permission to download
Fixed issue where bringing the app to front wouldn't update counters in XenForo 2.3
  • Changed JavaScript to work regardless if XenForo core JavaScript is lazy loaded or not (2.3 compatibility)
By default XenForo relies on a browser being willing to subscribe to push notifications if the user previously granted permission. Safari (and iOS PWA) does not work that way, even a re-subscribe needs to be initiated by a user gesture (see this post). This causes iOS PWA (and desktop Safari browsers) to "lose" their push subscription since XenForo is relying on browsers to re-subscribe. This updates changes some XenForo behavior to fix that:
  • Push subscriptions are not unsubscribed when a user is re-authenticating two-step.
  • Ideally, this shouldn't be the case, but if (for whatever reason) XenForo triggers a push unsubscribe, if the browser is Safari (or PWA), we also clear the push_history_user_ids localStorage, which will allow the push notice to show again for the user so they can choose to re-subscribe (with a user gesture, so it works). It's not realistic to expect users to know to resubscribe with a button buried in their settings.
TL;DR: This should solve the issue XenForo has where iOS PWA users lose their push subscriptions (or at the very least least make it happen less often).
All JavaScript has been rewritten to be "native" (does not use jQuery) in preparation for removal of jQuery in XenForo 2.3.

If you aren't using XenForo 2.3, you don't need to upgrade (might be some unmeasurable speed increase [think nanoseconds] when running its JavaScript since it doesn't dip into jQuery any longer).
  • PHP 8.1+ compatibility fix
  • Requires XenForo 2.2.13+
  • Require a CSRF token for a user to use logout link
  • Like
Reactions: olalavui
  • Added ability to send push notices to users (Admin -> Communications -> Push users)
  • New PWA option: Enable debugging (you are welcome to enable this, but it was intended for me. It spews stuff to your server error log... but feel free)
    • Logs changes to user push subscriptions
    • Logs web push server errors
  • Delete push_subscription_updated session cookie when a new session is created (causes push subscription endpoint to be updated if old one was expired)
  • Add attribute to manifest tag to instruct browsers to include credentials (cookies) when making request for manifest file (allows auto-login to PWA)
  • Don't unsubscribe user from push notifications if they log into admin area (normally XenForo will stop sending push notices if a user logs into the admin area until they return to a public page)
1692146408917.webp
This adds an option to specify JSON you want to merge into the web application manifest. This allows you to edit existing properties as well as add new properties (what you specify to merge into the manifest file takes precedent over what XenForo generates by default). Note: the option is an "advanced" option, so you need to show advanced options to see it.

As an example, say you had an older version of XenForo (<2.2.13) where the display property wasn't set to standalone, you could set display to standalone and you could also add a screenshots property:

1690300574954.webp
Back
Top Bottom