SuttaCentral

Get SC accepted in App stores


#1

PWA support in App Stores has increased recently! I’ve just put together some test Android and iOS apps to see what the best strategy for this might be. I’m not a professional app developer, but know a bit of Java and general coding and have tinkered with apps, and this is basically just a web browser with all the app-ness already done :slight_smile:

WebAPK
This is the current “Add To Home Screen” - I have read that this is not acceptable on Play store, but I am not 100% sure if this is still the case. This is obviously most preferable as it’s been tested.

Android Trusted Web Activity App
Only in the last few weeks, Google Play Store accepts a “Trusted Web Activity” as an app which would opens SC in Chrome full screen, and prompt to install Chrome if it isn’t installed:

https://medium.com/@firt/google-play-store-now-open-for-progressive-web-apps-ec6f3c6ff3cc

I’ve tested all the steps in this article, built the app, and it currently runs but only if you install Chrome Dev/Canary (which will become standard quite soon I expect). It still prompts for Home Screen addition though after install, and does not use already downloaded offline files.

I have source code up here, if you would like to build this yourself. There is a debug .apk in there that I say is safe to run, but it is never advisable to install an app from someone with only a few posts and inactive github! :smile::
https://github.com/michaelh-sc/suttacentral-android-twa-app.git

PWA Builder
A more promising and immediately effective strategy is probably using https://pwabuilder.com / Cordova . I’ve tested this and it works very well so far on my two Android phones. I just need to test it a bit more on AWS device farm to make sure it is consistent - if browser engine changes for old phones, etc.

Initial testing is good - it downloads suttas and pretty much feels like the current home screen app. It downloads sutta data into the app’s data portion itself rather than browser cache (240MB for English + pali root text). No splash screen yet, and I am seeing small “Network Error” icon behind the menu when I go completely offline, but generally feels very very usable!:
https://github.com/michaelh-sc/suttacentral-android

Note I had to hard code a user agent as Chrome because Cordova isn’t recognised currently by SC site code. I think targeting Cordova could let you do things just for phones/devices with the app.

iPhone
I’m currently in early stages of an iPhone app too using the PWA Builder strategy. This is still Cordova - I believe it would use Safari’s code base and should work in iOS11.3+

https://medium.com/@firt/progressive-web-apps-on-ios-are-here-d00430dee3a7
It appears that the iPhone app might become the first hit on a search made in the iPhone search field, which would be cool.

Perhaps I should start a new thread to talk about the feasibility of these with tech and if there are any concerns with supporting this as a platform? The Polymer stuff is a little complicated, I don’t understand how the caching/ServiceWorker stuff works too well. It might be possible to pre-bundle a lot of the site elements or kick off a small offline download too on install, who knows! :slight_smile: Also if anyone thinks I should take these off my github for some reason that’s possible too.

:anjal::anjal::anjal:


What should a SuttaCentral app be like?
#2

Wow, thanks for the help, this is fantastic. We have an issue for this, but so far it is just a note with an intention:

Let’s look at the options, I’ll do some research on my end as well.

Philosophically, we want the solution that stays most closely tied to web standards and does the least to the app that is possible. We’re not so much worried about getting accepted everywhere right now, it’s more important to build for the future. The more closely any app sticks to the website, the easier it will be to update and maintain in the future.

Hence I’d rather avoid legacy solutions like Cordova: it was built to solve an older generation of problems. Modern PWAs should just work on the platform.

Let’s focus on getting the Android version working well with TWA, then look at iOS.


#3

Thanks for the encouragement Ajahn! I will focus on TWA and leave Cordova/WebView on hold, and update https://github.com/suttacentral/suttacentral/issues/1339 instead of this thread.