apache / cordova-ios

Apache Cordova iOS
https://cordova.apache.org/
Apache License 2.0
2.16k stars 986 forks source link

App not loading due to iOS Screen Time web content restrictions #1490

Closed graemian closed 2 months ago

graemian commented 2 months ago

Bug Report

Problem

What is expected to happen?

First app screen is shown after launch

What does actually happen?

An error screen is shown with the message: 'You cannot browse this page at “localhost” because it is restricted'

Finder 2024-09-09 18 21 02

Tapping "Allow Website" does nothing.

Information

This happens when "Content & Privacy Restrictions" are enabled in Settings > Screen Time, and "Web Content" is set to "Only Approved Websites" under "Store, Web, Siri & Game Center Content"

If the website "localhost" is added to the list of approved websites ("Add Website"), everything works fine.

Command or Code

Enabled the restrictions as above and install and launch any Cordova app (try mine: https://apps.apple.com/us/app/bomad-kids-money-tracker/id6446114229)

Environment, Platform, Device

I’ve tested on iPadOS 17.5.1 and iOS 17.6.1

Version information

I'm using Meteor 2.16 (meteor.com), which in turn uses Cordova iOS v7.0.1

Checklist

graemian commented 2 months ago

Upon further investigation, I see that Cordova only serves files using the file scheme (file:///). It is Meteor that extends Cordova with a local web server to serve files over http.

As such, I've opened an issue directly with Meteor (https://github.com/meteor/meteor/issues/13339) and I'm closing this one.