Ionic App被iOS“仅限特定网站"限制阻止 [英] Ionic App blocked by iOS 'Specific Website Only' restriction

查看:160
本文介绍了Ionic App被iOS“仅限特定网站"限制阻止的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

用户的iOS设备在设置中设置了限制,仅允许仅限特定网站".结果,一个Ionic应用程序将显示启动屏幕,但此后不执行任何操作.

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.

大概必须在设置中输入应用程序的特定本地URL.该网址是什么?

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

如果为网站启用限制成人内容"设置,也会被屏蔽.

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

推荐答案

我遇到了类似的问题,即应用程序无法访问本地主机. Ionic现在使用本地服务器(因为引入了wkwebview)来提供本地文件.当设备的限制设置为仅限特定网站"时,该应用将仅在启动屏幕之后显示空白白屏.

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.

http://localhost 添加到允许的允许工作的站点列表中.

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

此外,删除和添加ios平台也有所帮助.闪动后并未显示空白屏幕,而是显示一条消息,指出该站点受到限制并向用户提供允许.

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.

要删除和添加ios平台,请执行以下操作: (摘自wkwebview的ionic文档- https://ionicframework.com/docs/wkwebview/ )

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

确保Xcode已关闭

干净安装:

rm -rf platforms
rm -rf plugins

重新添加平台

ionic cordova platform add ios

确保允许使用本地主机:

Make sure localhost is allowed:

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

确保WKWebView是默认引擎:

Make sure WKWebView is the default engine:

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

构建离子iOS

ionic cordova build ios

打开Xcode,然后尝试重新构建.

Open Xcode and try to build again.

这篇关于Ionic App被iOS“仅限特定网站"限制阻止的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆