Xamarin iOS从URL获取数据时,Azure Blob存储URL始终为空

Xamarin iOS从URL获取数据时,Azure Blob存储URL始终为空,ios,azure,xamarin,azure-storage-blobs,Ios,Azure,Xamarin,Azure Storage Blobs,因此,我使用以下代码从url获取图像: using (var url = new NSUrl(_img)) using (var data = NSData.FromUrl(url)) { scrollView = new UIScrollView(new CGRect(0, 0, View.Frame.Width, View.Frame.Height)); View.AddSubvi

因此,我使用以下代码从url获取图像:

using (var url = new NSUrl(_img))
            using (var data = NSData.FromUrl(url))
            {
                scrollView = new UIScrollView(new CGRect(0, 0, View.Frame.Width, View.Frame.Height));
                View.AddSubview(scrollView);
                imageView = new UIImageView(UIImage.LoadFromData(data));
                //imgLoanDocument.SizeToFit();
                scrollView.ContentSize = imageView.Image.Size;
                scrollView.AddSubview (imageView);
                scrollView.Scrolled += DidScroll;
            }
如果我从网络上抓取任何随机图像,这就可以了

但是,如果我尝试在通过API调用构造的Azure Blob存储帐户中使用我的一个Blob的URL,如下所示:

http://myazureaccount.blob.core.windows.net/cd8ce230-715e-473d-9c08-98221691c96e/a15de7d3-0947-41fc-b5b3-6dc45d8f42fe?sv=2015-12-11&sr=b&sig=2skZ9e6iJWprRQX2Zmff%2BwfivgXS903aaBYZFUaNH1I%3D&st=2017-04-11T03%3A05%3A53Z&se=2017-04-11T03%3A30%3A53Z&sp=r
然后
var data=NSData中的
data
。FromUrl(url)
始终为空。我可以将这个完全相同的URL发送给自己,然后查看图像(我甚至可以在iOS消息应用程序中预览)。如果我在浏览器中输入这个URL,它会自动下载,如果我使用Chrome的inspector查看URL,我会看到图像的预览

我甚至为使用非https URL添加了一个plist密钥:

<key>NSAppTransportSecurity</key>
    <dict>
        <key>NSAllowsArbitraryLoads</key>
        <true/>
    </dict>

但是上面的plist条目不应该解决这个错误吗?

当您发出错误请求时,请查看设备/模拟器日志。首要问题是ATS问题,您可以将添加到您的
info.plist
问题中的
NSAppTransportSecurity
添加到您的问题中吗?您可以共享blob的实际URL吗?@GauravMantri很遗憾,我无法共享URL。@Sushingover让我试试,看看有什么效果happens@James从设备/模拟器中手动删除应用程序,并执行清理,然后重新构建应用程序只是为了确保您的info.plist更改被拾取。
App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure. Temporary exceptions can be configured via your app's Info.plist file.