Hope you are having a great day, I have created a DHIS2 app using the app platform and I would like to install it as a web app on my phone.
I can see this option on my phone when I have the app open. However when I click the install as web app button, I see the Global app shell is what get’s selected rather than my actual app. If I select to install anyway then I just get sent to the dashboards page when opening it, rather than my specific DHIS2 web app. Is there some configuration I can add to my app so that it opens the specific app rather than selecting the global app shell?
I’ve tried both with setting:
pwa: { enabled: true }
And leaving it blank, but in both cases I just get the Global shell being added.
This is a very interesting question. I assume the app is not yet on the app_hub…?
Honestly, I will need to triage this post … but I have one question if you’ve had the chance to check. Did you try if this is the case for all apps and not just your app?
I saw you were able to got a decent response and a workaround from Kapa AI in another channel, so I’ll paste that here (with a couple additions) in case others come across this too:
Based on the knowledge sources, this is a known issue with DHIS2 version 42 and the Global Shell. Let me explain what’s happening and the available workaround.
The Issue
When the Global Shell is active (introduced in DHIS2 v42), installing an app as a PWA results in installing the Global Shell itself rather than the specific app. This is because the manifest.json file that gets loaded is a generic one for the Global Shell (pointing to “./apps”), which hosts the other apps inside of an iframe, instead of the app-specific manifest, as described in this Jira issue.
Workaround
According to the Jira issue, you can bypass the Global Shell to install your specific app by:
Navigate to your app using one of these URL formats:
<baseUrl>/dhis-web-<appName>/?shell=false or <baseUrl>/api/apps/<appName>/?shell=false
<baseUrl>/apps/<appName>?shell=false (which redirects to the relevant one above)
From that URL, the app should be installable as a PWA without the global shell
For example, if you’re trying to install the Capture app, you would go to:
<baseUrl>/dhis-web-capture?shell=false
This bypasses the Global Shell and allows you to install the specific app rather than the Global Shell wrapper.
Note on Configuration
The pwa: {enabled: true} setting in d2.config.js controls whether PWA features are enabled for your app during development and build, but it doesn’t affect this Global Shell installation behavior, which is a separate issue related to how apps are served in DHIS2 v42+.
We’re still looking at how to handle this, but let us know if you have any other questions!