我已经按照AWS的教程 (http://docs.aws.amazon.com/mobile/sdkforios/developerguide/setup.html) 使用Swift和Xcode设置了AWS sdk iOS 9应用程序。现在我正在尝试将文件上传到S3存储桶中。
我将以下代码添加到AppDelegate.swift文件中: // 初始化Amazon Cognito凭证提供程序
我也在 Info.plist 文件中包含了代码片段。
我将以下代码添加到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>
但我收到了这个错误。如果它要求我在Info.plist中放置凭据,我该怎么做?...还是我做错了其他事情?提前感谢您的帮助。
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`.