Enabling iOS web content restrictions breaks Meteor Cordova apps

Hi all,

My Meteor Cordova app (‎Allowance Tracker - Bomad on the App Store) won’t load because of iOS Screen Time web content restrictions. My users see the following screen after launching the app:

Tapping “Allow Website” does nothing.

This happens when web content is restricted to approved sites only:

If I add “localhost” as an approved site, it works:

I’ve tested on iPadOS 17.5.1 and iOS 17.6.1

So I think this means that no Meteor Cordova apps will work when web content is restricted like this on iOS?

I’ve searched but I haven’t been able to find much about this problem. I did find confirmation here though:

https://forums.developer.apple.com/forums/thread/732008

But nothing in the Cordova forums (GitHub - apache/cordova-ios: Apache Cordova iOS)

I tested another app (‎Chores & Allowance Bot on the App Store) which I think is a wrapper on a website and it worked without being “allowed” as above. I’m not sure what to make of that.

Any suggestions and advice would be much appreciated. Thanks!

P.S. Where else might I asked about this? I’m going to try Issues · apache/cordova-ios · GitHub

Here’s the Cordova iOS issue I just posted:

Have you tried this:

Thanks, but what specifically are you suggesting I try?

I think this sounds promising, but it would require changes to Meteor Cordova:

For those who are still stumbling upon this, newer versions of cordova-plugin-ionic-webview now support using the app scheme instead of serving over http://localhost. Using the app scheme will allow the app to not get blocked by iOS’ Content Restriction. Hope this helps!

Specifically,

would need to be changed to use “the app scheme” instead of http://localhost

It has been years since we moved to PWA so my cordova knowledge might be obsolete. But there should be an accessRule method for the config to set <allow-navigation>

Thanks, but I checked in my config.xml and Meteor already includes a rule to allow localhost access:

<allow-navigation href="http://localhost" />

This problem arises because recent versions of iOS block localhost when Screen Time is used to restrict web content. This overrides all the allow rules in the app.

1 Like

I’ve also filed a bug report on Github:

I just realized that pressing “Allow Website” on the error page:

adds “localhost” to the list of approved sites.

However, it doesn’t trigger a reload, so the error remains on the screen. It also doesn’t give any other kind of feedback, so it seems like nothing happened.

If you close the app and re-open it, it works. However, it’s not obvious that you need to do this.