简体   繁体   English

离子白名单插件阻止了iPhone,但可以在浏览器中使用

[英]Ionic whitelist plugin blocks the iPhone but works in the browser

I have an ionic mobile app that communicates with a backend. 我有一个与后端通信的离子移动应用程序。 It runs a simple login which works perfectly in android (browser/phone) and mac (just browser). 它运行一个简单的登录名,在Android(浏览器/电话)和mac(仅浏览器)中完美运行。 It fails when running on iPhone returning: 在iPhone上返回时运行失败:

 MyAppName[931:60b] ERROR whitelist rejection:

 url='https://login.myurlapi.com/apitest/validate.php'

I've checked the white-list-plugin documentation and should be find with the config added into my config.xml : 我已经检查了白名单插件文档,并且应该将配置添加到我的config.xml进行查找:

<access origin="myapiurl.com"/>
  <allow-navigation href="https://*/*"/>
  <allow-intent href="https://*/*"/>
  <preference name="webviewbounce" value="false"/>
  <preference name="UIWebViewBounce" value="false"/>
  <preference name="DisallowOverscroll" value="true"/>
  <preference name="android-minSdkVersion" value="16"/>
  <preference name="BackupWebStorage" value="none"/>
  <preference name="SplashScreen" value="screen"/>
  <preference name="SplashScreenDelay" value="3000"/>
  <feature name="StatusBar">
    <param name="ios-package" onload="true" value="CDVStatusBar"/>
  </feature>
  <platform name="ios">
    <access origin="myapiurl.com"/>
  </platform>

UPDATE : I've checked the logs and it looks like is not able to get even the default ionic style cascade sheets from: 更新 :我检查了日志,看起来甚至无法从以下位置获取默认离子样式级联表:

 ERROR whitelist rejection:
 url='http://code.ionicframework.com/ionicons/1.5.2/css/ionicons.min.css'

this is the configuration to fix the connectivity issue in iOS and keep it working properly in android, see how I'm using config within each platform instead of using global parameters: 这是用于解决iOS中的连接问题并使其在android中正常工作的配置,请参阅我如何在每个平台内使用config而不是使用全局参数:

  <content src="index.html"/>
  ...
  <preference name="SplashScreen" value="screen"/>
  <preference name="SplashScreenDelay" value="2000"/>
  <feature name="StatusBar">
    <param name="ios-package" onload="true" value="CDVStatusBar"/>
  </feature>
  <platform name="ios">
    <access origin="myapiurl.com"/>
    <icon src="resources/ios/icon/icon.png" width="57" height="57"/>
    <icon src="resources/ios/icon/icon@2x.png" width="114" height="114"/>
    ... 
  </platform>
  <platform name="android">
    <access origin="myapiurl.com"/>
    <allow-navigation href="https://*/*"/>
    <allow-intent href="https://*/*"/>
    <icon src="resources\android\icon\drawable-ldpi-icon.png" density="ldpi"/>
    ...
  </platform>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM