Building an iOS app that embeds Discourse

AI-generated summary

The discussion revolves around building an iOS app that embeds Discourse. Bryan_Underwood_CA wants to develop an iOS app that integrates their Discourse site and other services, and is considering using the Discourse native app code or API for a native user experience. However, featheredtoast suggests that using a webview is the best option, as Discourse is well-optimized for mobile browsers and they are banking on progressive web apps (PWAs).

Bryan_Underwood_CA decides to pursue the PWA approach and has set up a manifest.json file, but inquires about implementing a service worker. featheredtoast responds that they have a service worker in place, which is used for Android push notifications, but it only registers for non-iOS devices due to Apple’s service worker implementation limitations. They are adding features to the service worker as they become supported.

I have and use the Discourse mobile app for iOS. Is the app in the github repo here: DiscourseMobile/ios at main · discourse/DiscourseMobile · GitHub the source code for the publicly available iOS “DiscourseHub” app?

If so, it seems this app is just wrapping a Discourse site within a webview.
– am I wrong about this?

I would like to develop an iOS app which uses a few service SDKs (unrelated to Discourse) and to embed our Discourse site.

Has anyone successfully used either the Discourse native app code or API to provide a good, native user experience within a standalone iOS app?
– or is a Safari webkit view the best option? Discourse is excellent on all mobile browsers.

You stated the exact reason why we do webview. :wink:

We can share all the work we’ve done in our mobile view, and reuse it in “an app” by doing this. We’re still banking hard on the future of progressive web apps, so there is little to no benefit to rebuilding the Discourse UI in Yet Another App.

Thanks Jeff. Oh…kaaay… I’ve found tons of forum posts here about PWA. I think I’ll just go for it. My site has a manifest.json just like meta.discourse has. I have a name, icons, and start_url.

But what about a service worker? Is there a front-end setting for this or do I need to follow the tip here:

We’ve got one. This is how Android push notifications are working. Due to complications with Apple service worker implementations, it only registers for non-iOS. We’re adding features to the service workers slowly as they become supported.