Safari push notifications coming to macOS and iOS

There you go buddy.
Thanks.

Notification banners and app badges are working for me as well. It’s awesome that Apple is finally letting us kind of do this.

One thing I’m noticing is that the site is kind of choppy in the PWA whereas everything is smooth as normal in Safari.
 
Another thing that would make onboarding have a little less friction is if you were able to pass in the xf_user cookie to the PWA somehow. The app is installed, but now we aren't even logged in to the app. So now we have to install it, then log-in, maybe do 2FA and finally we can enable push.

Maybe set the PWA app URL's start_url _pwa value with something that could log the user in (a hashed token that would log the user in automatically with that URL within an hour or something)? If it's past an hour (just use the URL normally and ignore the "auto-login token").
As an extension to this, if XenForo is in PWA mode and push notifications haven't been set either way, maybe give a more prominent alert about asking the user if they want push notifications?

The flow I'd love to see is:
  • Install app on home screen, user is already/automatically logged into app
  • User opens app and gets a prominent message rather than the default one that is small/down at the bottom (that makes sense for normal web browsing, but less so for PWA app)
JavaScript:
XF.alert('Yo, do you want push notifications in this fancy app?  [Yes/No]', '', 'Push notifications available')
 
Thanks.

Notification banners and app badges are working for me as well. It’s awesome that Apple is finally letting us kind of do this.

One thing I’m noticing is that the site is kind of choppy in the PWA whereas everything is smooth as normal in Safari.
Are you getting the badge app without clicking going into the site first? Best way to check is when you first see the notification on your iPhone, go and look at the badge before launching. So far this has not worked for me on any site.
 
I think the choppiness feeling comes from the PWA not doing the over-scrolling thing that Safari does.
We’ve disabled over scrolling on the PWA in order to enable pull down to refresh.

Can you confirm if you keep trying to scroll it indicates it will refresh the page?
 
Are you getting the badge app without clicking going into the site first? Best way to check is when you first see the notification on your iPhone, go and look at the badge before launching. So far this has not worked for me on any site.
Same as you — badge count doesn’t update without opening the PWA and refreshing the page first.
 
Maybe someday Web Push will allow revoking push notifications like other apps do (like if the user clears their alerts in a normal browser), but doesn't seem technically possible at this point. Seems strange that the push notifications aren't even cleared when you open the app, but maybe just a limitation of PWA. 🤷🏻‍♂️
 
maybe just a limitation of PWA
As happy as I am to finally have some type of push notifications for my own site, everything else about PWA has always sucked. And I don’t feel like people are putting websites on their home screen (if they even realize they can) because just using Safari (or your iOS browser of choice) is better in every way, in my opinion (except for push notifications).
 
My phone is, unfortunately, completely messed up when it comes to anything JavaScript based on this site.

We added pull to refresh to the iOS PWA because it’s absent for reasons no one understands but it doesn’t actually work on my phone. It’s like the code doesn’t exist.

I still have issues in the editor that were fixed upwards of a few years ago.
I had that exact issue about a year and a half ago. It has to do with the sync between your Mac and the iPhone. The solution to fix stuff like that while working was to do a completely clean disconnect of iCloud on ALL iCloud devices, and then clear cookies, cache, etc. on each one while you turn it back on.

When one Apple device messes up and doesn't correct, it does sync those problems across.
 
I don’t usually swear on here but what the ****!

I just signed out of iCloud and everything that wasn’t working is now working.

The editor problem that I think has existed since 2021 has gone. The changes I rolled out here today are now working.

I expect logging back in might bring the issues back but at least I have something to work with now. Thank you!!
 
I don’t usually swear on here but what the ****!

I just signed out of iCloud and everything that wasn’t working is now working.

The editor problem that I think has existed since 2021 has gone. The changes I rolled out here today are now working.

I expect logging back in might bring the issues back but at least I have something to work with now. Thank you!!

No problem ❤️

I once talked to a senior apple engineer about it because I kept throwing everyone for a loop with the issue, that I discussed it with, and it eventually got escalated enough to where someone who understood iCloud talked to me, it had halted everything I did including testing code, styling, etc. Like you, I also had bugs and code changes I couldn't see for 2-3 years, it just got to the point where I could finally notice.

I recommend, as you disconnect all your devices, to load up the site and make sure that you can see everything you except on every iCloud synced device. Then connect them back in.
 
Last edited:
Top Bottom