Adding Swift Forums to iPhone/iPad Home Screen


(Lukas Stabe 🙃) #1

Adding the Swift Forums to the iOS Home Screen currently results in a shortcut that opens the Forums in Safari. Adding an HTML meta tag, <meta name=”apple-mobile-web-app-capable” content=”yes”>, would make the forums open in a more app-like way.

Additionally, the icon is currently a Discourse icon, I think there is another meta tag that specifies an icon.


(Jon Shier) #2

There’s also a Discourse app, but that’s just slightly more than a Safari view.


(Lukas Stabe 🙃) #3

That one is nice because it provides Notifications. I would however prefer not having the browser chrome around the Forums, since it seems all Navigation is possible using the web app itself.

Wrt. notifications, maybe future iOS versions will allow web notificatoins, at which point The native app wouldn’t be needed at all.


(James Froggatt) #4

This would be especially nice with the dark theme, where the Safari title bar can be distractingly bright.


(Brent Royal-Gordon) #5

The generic Discourse icon is almost entirely black, so it’s hard to recognize. We should at least replace that with the Swift logo.


(Saagar Jha) #6

I believe this is because the icon is partially transparent, and iOS will replace this with a black color for app icons.


(James Froggatt) #7

Since this hasn’t been specifically posted anywhere - this feature seems to have been enabled. The Swift Forums work as an app when saved to the homescreen.

edit: And it looks wonderful! 😄


(Ryan Lovelett) #8

@MutatingFunk perhaps I am missing it but I do not see the <meta> that @ahti mentioned and my page is not running in full-screen mode. Also the icon still looks like the black one.


(James Froggatt) #9

The icon is still black. I’m not too bothered about that.

The specific page I tested this on and can confirm it works is the Latest tab.


(Lukas Stabe 🙃) #10

Full-screen isn’t working for me either right now. Did you add the forums to the home screen from a specific page or just from the root?


(James Froggatt) #11

From the Latest tab, which I believe is the root. (forums.swift.org/)

This is when signed in, but that seems unlikely to be the difference here.

edit: Just tried again from a thread, ‘add to home screen’ seemed to change the address to root. Still worked as a standalone app when launched.


(Nicole Jacque) #12

I’ll try adding the meta tag.


(Nicole Jacque) #13

Added. See if that makes a difference.


(James Froggatt) #14

Waiting for feedback from someone else, I’m not noticing any difference.

When I originally posted in this thread, ten days ago, this wasn’t working. I’m very curious as to why it’s started working for me, but not for anyone else. I’ve been testing on iPad.

The reason I thought to check was that, earlier today, my internet connection was lost [edit]while browsing the forums[/edit], and I got a Discourse-style page saying the ‘app’ wasn’t connected to the internet and wouldn’t work. At the time, I was running through the Discourse app which uses SafariVC, so I would have expected a generic Safari ‘load failed’ error.

*edited for clarity.


(Lukas Stabe 🙃) #15

I’ve just tried on both iPhone and iPad, neither is working. I’ve also cleared caches and checked the Safari inspector and couldn’t find the tag. Is there maybe some load balancer or caching layer that might still be serving me the old page?


(James Froggatt) #16

Just curious, do you get a Discourse message when the internet connection is disabled while browsing, or a standard page load error?


(Lukas Stabe 🙃) #17

The normal Safari one. With all the Safari chrome as well.


(James Froggatt) #18

Checking the source on my laptop, this tag is present:

<meta name="”apple-mobile-web-app-capable”" content="”yes”">

Whatever got it working, before the Swift forums were updated with this tag, must have been a Discourse-side update. Perhaps an A-B test, or slow to roll out due to caching? I have no idea.

edit: Unless it’s somehow the iOS 11.3 beta? I’ve heard ‘service workers’ mentioned a bit.


(Lukas Stabe 🙃) #19

I just tried my Chrome, which had never been on the page and it receives the tag (with the same messed-up quotes), so I assume it must be a caching thing, despite me clearing caches 🤔


(Lukas Stabe 🙃) #20

Ah, turns out it was the dark theme. The tag only shows up when the light theme is used.