更新至iOS 10后,Cordova应用程序无法与Dynamics导航Web服务(ODATA)连接 [英] Cordova app can't connect with Dynamics NAV Web-Service (ODATA) after update to iOS 10

查看:123
本文介绍了更新至iOS 10后,Cordova应用程序无法与Dynamics导航Web服务(ODATA)连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在使用Cordova开发应用程序,该应用程序将信息与Microsoft Dynamics导航2013中间层提供的ODATA Web服务进行同步. 在Android下,连接没有问题,在iOS 8和9下,它也可以正常工作.在使用iOS 10的设备上,连接不起作用,并返回HTTP 400错误请求错误. 连接具有以下结构(这是测试代码,适用于Android,iOS 8和9,但不适用于iOS 10)

We are developing an app with Cordova that syncs information with an ODATA Web-Service made available by a Microsoft Dynamics NAV 2013 Middle tier. Under Android there is no problem with the connection and under iOS 8 and 9 it works as well. On Devices using iOS 10 the connection does not work and returns a HTTP 400 Bad Request error. The connection has the following structure (this is test code, works on Android and iOS 8 and 9, but not on iOS 10)

var xreq = new XMLHttpRequest();
xreq.open('GET', "http://domain:port/MIDDLETIER/OData/MobileSetupMWP?$format=json",true,username,password);
xreq.onreadystatechange = function () {
  if (xreq.readyState == 4) {
      if (xreq.status == 200) {
        alert("success");
      } else {
        alert("failure");
      }
  }
}
try {
  xreq.send();
} catch (e) {
  }

该Web服务使用摘要作为身份验证,并且可以作为http和https Web服务使用. http和https均可在Android和iOS 8和9上使用.未经身份验证即可连接到http ODATA Web服务( http://services.odata.org/V3/OData/OData.svc/)可在iOS 10上运行,因此问题似乎与身份验证有关.

The Web-Service uses Digest as authentication and is available as a http and a https Web-Service. Both the http and https work with Android and iOS 8 and 9. Connecting to a http ODATA Web Service without authentication (http://services.odata.org/V3/OData/OData.svc/) works on iOS 10 so the problem seems to be related to the authentication.

我们已经在插件中包含以下部分:

We have already included the following part in a plugin:

<platform name="ios">
        <config-file target="*-Info.plist" parent="NSPhotoLibraryUsageDescription">
            <string>Für Bildvorschau wird die geräteeigene Fotogalerie verwendet</string>
        </config-file>
        <config-file target="*-Info.plist" parent="ITSAppUsesNonExemptEncryption">
            <false/>
        </config-file>
        <config-file target="*-Info.plist" parent="NSAppTransportSecurity">
            <dict><key>NSAllowsArbitraryLoads</key><true /></dict>
        </config-file>
    </platform>

这是我们正在使用的内容安全政策

This is the Content Security Policy we are using

<meta http-equiv="Content-Security-Policy" content="default-src * blob: data: ws: wss: gap://ready ; style-src 'self' 'unsafe-inline' 'unsafe-eval' * ;
    script-src 'self' 'unsafe-inline' 'unsafe-eval' * ; connect-src * 'self' 'unsafe-inline' 'unsafe-eval' data: blob: ws: wss: ; img-src * data: blob:">

有什么想法可能是问题还是我们可以测试什么?

Any ideas what the problem could be or what we could test?

推荐答案

Apple在10.2 Beta版本中解决了该问题.再次可以与DIGEST Web服务建立连接.

The problem was solved by Apple with the 10.2 Beta version. Connection with DIGEST Web Services is possible again.

这篇关于更新至iOS 10后,Cordova应用程序无法与Dynamics导航Web服务(ODATA)连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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