XF 2.2 Progressive web app

Not open for further replies.
Mobile app installation
Mobile first. We hear it again and again, and with over half of all web traffic coming from mobile devices, it's more important than ever to provide your mobile visitors with a great experience.

Of course, XenForo 2 is built on a fully responsive design that gracefully adapts to any display size and makes using XenForo a pleasure on all devices, but now we're taking it a step further by enabling any XenForo site to become a progressive web app.

Progressive web what?

Okay, let's back up a little. Imagine a technology that allows a web site to appear and behave like an app without having to produce native code for each platform, or go through any vendor's App Store equivalent.

Progressive web apps, or PWAs, aim to bridge the gap between websites and native applications on both mobile and desktop devices using a series of emerging web standards. Push notifications, a feature introduced in XenForo 2.1, are a popular example of one such standard. In XenForo 2.2, we're expanding our support for these standards by making XenForo installable, implementing more graceful offline handling, and adding support for the badging API.

Setting it up

It's important to note that, like push notifications, making full use of these features will require a few extra steps to set things up.

Additionally, as with push notifications, these features are only available on devices and browsers that fully support PWAs. Would you care to take a guess as to what the most notable exceptions might be? As you may have suspected, once again Safari on macOS and any iOS-based browsers are the culprits due to Apple's ongoing failure to implement industry standards. While Safari on both macOS and iOS does support graceful offline handling, it does not support installation or badging (more on that below) at this time.

We would encourage you to make your frustrations known in public by applying virtual tar and feathers to Apple employees online until they relent and get their act together... or at least voice your support for these standards by continuing to reach out to @webkit on Twitter or the webkit-help mailing list. Officially, the best place to communicate with Apple is via their product feedback channels, and presumably they won't be able to continue to ignore a deluge of feature requests for the same thing... 🤔


To make full use of these features...
  • Your XenForo installation must be accessed over SSL / HTTPS
  • Your site must have a relatively short title of 12 characters or fewer
  • You must publish a pair of square icons for your site, one at 192px and another at 512px.

Setting a short title

Publishing a pair of icons

What do PWAs look like?

If your site meets the requirements, your visitors will automatically be given the option to install your 'app' on their device.

The precise details of the interface and the circumstances permitting installation can vary by browser and in some cases can depend on the degree of interaction with your site a user has had.

When browsing with Chrome on desktop or Android, the app can be installed via the address bar on both mobile and desktop devices. On supported mobile devices, we also display a conspicuous yet unobtrusive banner in the off-canvas menu.

Mobile app install banner
Mobile app installation

Desktop app installation

Once the app is installed, it is readily available in exactly the same way as a native app. On mobile devices, that means it can be opened via an icon on the home screen. On desktop devices, it can be opened by searching your system or even pinning the app to your taskbar or dock.

Mobile app home screen
Desktop app home screen

Some devices will display a splash screen while the app is being loaded. The splash screen is automatically generated from the icons and background color of your style.

Mobile app splash screen

For most devices, we set the app to display a minimal interface. The elements of this interface also vary by browser, but most importantly include navigation controls. For Android devices running Chrome, we are able to use the native pull-to-refresh and back-button navigation controls, so we do without any additional interface.

Mobile app
Desktop app

If a user tries to open or navigate the app without a proper network connection, we display a simple offline message.

Mobile app offline page
Desktop app offline page

Chrome-based apps recently introduced support for application badging, which allows the app to indicate unread messages or alerts directly on its icon.
We are hopeful more browsers will support the badging API in the future.

Desktop app badging (Windows)

Looking toward the future

The PWA specification and standards are constantly evolving. We will continue to monitor them as time goes on in order to always provide the best possible experience on all devices.
Will this feature be toggle-able by admins?

Are we talking about disabling the feature entirely? There was a big discussion about this with respect to iOS etc so I won't repeat that but we'd absolutely want to turn this off so as not to appear to be prioritising some users over others.
I was a little skeptical about bookmarking as an in-app/site feature when it was initially introduced in XF (as I thought it's something better done in the browser). In the context of PWA though, in-app/site bookmarking makes a lot of sense. The thing that is lacking (in contrast to browser functionality) is an ability to group/organize bookmarks into folders.
The thing that is lacking (in contrast to browser functionality) is an ability to group/organize bookmarks into folders.
i was referring to the pwa as a whole
Depends on how PWA is configured. For my custom PWA I had pre-caching configured so on first load, it populates a visitors' browser cache storage area with XF common page assets like css, js, images and my admin user avatar image. This allows subsequent page loads by repeat visitors to be much faster at the expense of first request full page load to be longer. Which doesn't matter as Google looks at above fold/perceived render time via FCP/LCP/Speed Index which when optimally configured won't change with my pre-cached assets for FCP/LCP/SpeedIndex metrics but instead improve them as subsequent page visits by repeat users will have much faster FCP/LCP/Speedindex due PWA pre-caching of XF assets which never go over a remote network connection but via local browser cache storage (different from normal browser HTTP cache storage area).
Did Apple announce pwa support today? I did read about widgets and even ability to select a third party browser and email client but not pwas. But then pwas are not really a headline making functionality for tech blogs.
Have they ever talked about webkit and similar on a WWDC? I don't recall in recent memory over the past few years. While I'm not holding my breath, it is quite possible that it will just come into webkit.
Oooohhh. Just installed the PWA. Neat. I like it. Looking forward to having it for my users.

Can anyone do a breakdown on what is missing from the iOS version? I'm on Android.
For the Android users, if you've selected the "Install App" option from the mobile hamburger menu, did an icon actually get installed on your home screen? 🤔

For me it 'installed' and created an icon in the normal apps listing but nothing got placed on the home screen.... and, thinking out loud, I remembered that I have the option to automatically add new apps to my home screen turned off. 💡 With that in mind is the text value about 'XF has been added to your home screen' coming from Android or an XF phrase? If the mentions of 'home screen' are XF phrases then I'm thinking I'll need to update ours to just say something like 'add shortcut' or similar instead of 'home screen'.
For the Android users, if you've selected the "Install App" option from the mobile hamburger menu, did an icon actually get installed on your home screen? 🤔
Yes. Well technically it went to the 3rd screen because of the apps I have installed but I can move it to my home screen if I want.
I'm just trying this out on Chrome. Apart from the fact it says the name of the thread across the top, what exactly is different?

What should I be looking out for?
Not open for further replies.
Top Bottom