1

A user has an iOS device with restrictions set in the settings to only allow 'Specific Websites Only'. As a result, an Ionic app will show the splash screen, but not do anything after that.

Presumably, the specific local URL of the app must be entered in the settings. What would that URL be?

Edit: It's also blocked if enabling the 'Limit Adult Content' setting for websites.

3 Answers3

0

Are you developing the app itself and you don't know what URL it's connecting to? If this is not your app, then ask the developer what is the URL and add it to the allowed list, there's no way to find it out otherwise. The local index.html URL should not be blocked, otherwise no Cordova-based app would work with this behavior.

andreszs
  • 2,896
  • 3
  • 26
  • 34
0

I've had a similar issue where the app couldn't access localhost. Ionic now uses a local server (since wkwebview was introduced) to serve local files. When the device's restrictions were set to 'Specific Websites Only', the app would just show a blank white screen after the splash screen.

Adding http://localhost to the list of allowed sites worked.

Also, removing and adding the ios platform helped a bit. Instead of showing a blank white screen after splash it showed a message saying that the site is restricted and offers the user to allow it.

To remove and add the ios platform: (taken from the ionic docs for wkwebview - https://ionicframework.com/docs/wkwebview/)

Ensure Xcode is closed

Clean install:

rm -rf platforms
rm -rf plugins

Add the platform back

ionic cordova platform add ios

Make sure localhost is allowed:

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

Make sure WKWebView is the default engine:

<feature name="CDVWKWebViewEngine">
  <param name="ios-package" value="CDVWKWebViewEngine" />
</feature>
<preference name="CordovaWebViewEngine" value="CDVWKWebViewEngine" />

Build ionic ios

ionic cordova build ios

Open Xcode and try to build again.

Dayveed
  • 16
  • That's great information - thank you! I've not tried the last couple of steps, but will try later. For now, adding localhost to the list of allowed sites does the trick, but would indeed be good to see that other message. Thanks again! – user2722537 May 10 '18 at 10:47
0

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!

Justin Cuaresma
  • 459
  • 5
  • 7