AWS S3 integration in Swift 2.2 Xcode 7.3 gives error

Refresh

March 2019

Views

912 time

1

I have integrated the AWS S3 ADK version 2.4.9 in iOS App. Am seeing the below weird issue in my xcode.

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

Please help !

1 answers

4

You need to set the default SDK configuration through code or info.plist file of your app to use the defaultS3 client.

To do it via info.plist:

You need to replace the pool id and the regions for cognito identity id and S3 below.

<key>AWS</key>
    <dict>
        <key>CredentialsProvider</key>
        <dict>
            <key>CognitoIdentity</key>
            <dict>
                <key>Default</key>
                <dict>
                    <key>PoolId</key>
                    <string>YOUR_POOL_ID_HERE</string>
                    <key>Region</key>
                    <string>USEast1</string>
                </dict>
            </dict>
        </dict>
        <key>S3</key>
        <dict>
            <key>Default</key>
            <dict>
                <key>Region</key>
                <string>USEast1</string>
            </dict>
        </dict>
    </dict>

To do it via code

AWSCognitoCredentialsProvider *credentialsProvider = [[AWSCognitoCredentialsProvider alloc] initWithRegionType:CognitoRegionType
                                                                                                identityPoolId:CognitoIdentityPoolId];
AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:DefaultServiceRegionType
                                                                     credentialsProvider:credentialsProvider];
AWSServiceManager.defaultServiceManager.defaultServiceConfiguration = configuration;

Thanks, Rohan