Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/swift/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios AWS SDK S3上传Credentails_Ios_Swift_Amazon Web Services_Amazon S3_Sdk - Fatal编程技术网

Ios AWS SDK S3上传Credentails

Ios AWS SDK S3上传Credentails,ios,swift,amazon-web-services,amazon-s3,sdk,Ios,Swift,Amazon Web Services,Amazon S3,Sdk,我遵循AWS的本教程()使用swift和xcode设置AWS sdk iOS 9应用程序。我正在尝试将文件上载到S3存储桶 我在AppDelegate.swift文件中添加了以下代码 //初始化Amazon Cognito凭据提供程序 let credentialsProvider = AWSCognitoCredentialsProvider(regionType:.USEast1,identityPoolId:"mypoolid") let configuration = AWSServi

我遵循AWS的本教程()使用swift和xcode设置AWS sdk iOS 9应用程序。我正在尝试将文件上载到S3存储桶

我在AppDelegate.swift文件中添加了以下代码 //初始化Amazon Cognito凭据提供程序

let credentialsProvider = AWSCognitoCredentialsProvider(regionType:.USEast1,identityPoolId:"mypoolid")

let configuration = AWSServiceConfiguration(region:.USEast1, credentialsProvider:credentialsProvider)

AWSServiceManager.defaultServiceManager().defaultServiceConfiguration = configuration
我还将代码片段包含在Info.plist文件中

<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
    <key>amazonaws.com</key>
    <dict>
          <key>NSThirdPartyExceptionMinimumTLSVersion</key>
          <string>TLSv1.0</string>
          <key>NSThirdPartyExceptionRequiresForwardSecrecy</key>
          <false/>
          <key>NSIncludesSubdomains</key>
          <true/>
    </dict>
    <key>amazonaws.com.cn</key>
    <dict>
          <key>NSThirdPartyExceptionMinimumTLSVersion</key>
          <string>TLSv1.0</string>
          <key>NSThirdPartyExceptionRequiresForwardSecrecy</key>
          <false/>
          <key>NSIncludesSubdomains</key>
          <true/>
    </dict>
</dict>

我的问题是文件没有上传到S3 bucket…凭据设置中有错误…在serviceConfiguration中,创建bucket的区域不正确…一旦我更改了文件的上传位置。

您没有通过
Info.plist
提供配置。相反,您使用的是
defaultServiceConfiguration
。您可以安全地忽略此消息。很抱歉回答得很简短,由于代表率低,我无法发表评论。我不确定这是否是您的情况,但在我的应用程序中设置身份池时,我缺少该区域。应用程序代理中的identityPoolId也应包括它。请尝试:让credentialsProvider=AWSCOgnitoRedentialsProvider(regionType:AWSRegionType.USEast1,identityPoolId:“us-east-1:xxxxxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxx”)发表您的评论…我只是以键入“mypoolid”为例
AWSServiceInfo initWithInfoDictionary:checkRegion:] | 
Couldn't read credentials provider configurations from `Info.plist`. 
Please check your `Info.plist` if you are providing the SDK configuration values through `Info.plist`.