简体   繁体   中英

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). It fails when running on iPhone returning:

 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 :

<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:

  <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>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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