AWS SDK for iOS 2.0 Developer Guide Table of Contents What Is the AWS SDK for iOS? ..... 1

Click here to load reader

  • date post

    29-May-2020
  • Category

    Documents

  • view

    3
  • download

    0

Embed Size (px)

Transcript of AWS SDK for iOS 2.0 Developer Guide Table of Contents What Is the AWS SDK for iOS? ..... 1

  • AWS SDK for iOS 2.0 Developer Guide

  • AWS SDK for iOS 2.0: Developer Guide Copyright © 2014 Amazon Web Services, Inc. and/or its affiliates. All rights reserved.

    The following are trademarks of Amazon Web Services, Inc.: Amazon, Amazon Web Services Design, AWS, Amazon CloudFront, Cloudfront, Amazon DevPay, DynamoDB, ElastiCache, Amazon EC2, Amazon Elastic Compute Cloud, Amazon Glacier, Kindle, Kindle Fire, AWS Marketplace Design, Mechanical Turk, Amazon Redshift, Amazon Route 53, Amazon S3, Amazon VPC. In addition, Amazon.com graphics, logos, page headers, button icons, scripts, and service names are trademarks, or trade dress of Amazon in the U.S. and/or other countries. Amazon's trademarks and trade dress may not be used in connection with any product or service that is not Amazon's, in any manner that is likely to cause confusion among customers, or in any manner that disparages or discredits Amazon.

    All other trademarks not owned by Amazon are the property of their respective owners, who may or may not be affiliated with, connected to, or sponsored by Amazon.

    AWS SDK for iOS 2.0 Developer Guide

  • Table of Contents What Is the AWS SDK for iOS? ........................................................................................................ 1

    About the AWS Mobile Services ............................................................................................... 1 Amazon Cognito ........................................................................................................... 1 Amazon Mobile Analytics ................................................................................................ 1

    About the SDK for iOS ........................................................................................................... 2 Next Steps ........................................................................................................................... 2

    Set Up the SDK for iOS .................................................................................................................. 3 Setting Up ............................................................................................................................ 3

    Get the iOS SDK ........................................................................................................... 3 Include the SDK for iOS in an Existing Application ....................................................................... 3

    Get AWS Credentials with Amazon Cognito or AWS Identity and Access Management .............. 5 Run the Demos ..................................................................................................................... 5

    Run the Amazon S3 TransferManager Sample ................................................................ 5 Run the Amazon DynamoDB Object Mapper Sample ........................................................... 6

    Install the Reference Documentation in Xcode ............................................................................ 6 Getting Started with Services .......................................................................................................... 8

    How to Authenticate Users ...................................................................................................... 8 Amazon Cognito Overview .............................................................................................. 9 Prerequisites ................................................................................................................ 9 Cognito Security ............................................................................................................ 9 Cognito Identity Pools ................................................................................................... 10 Setting Up Identity Provider Applications .......................................................................... 10 Integrating Identity Providers ......................................................................................... 12 Providing AWS Credentials ............................................................................................ 13 Getting an Amazon Cognito ID and AWS Credentials ......................................................... 14

    How to Sync Profile Data ...................................................................................................... 15 Profile Data Synchronization .......................................................................................... 15 Initializing the Cognito Sync Client .................................................................................. 15 Datasets .................................................................................................................... 16 Reading and Writing Data in Datasets ............................................................................. 16 Synchronization ........................................................................................................... 16 Conflict Resolution Handler ........................................................................................... 17

    How to Use Analytics in Your App ........................................................................................... 18 What is Amazon Mobile Analytics ................................................................................... 18 Integrating Amazon Mobile Analytics ............................................................................... 18

    How to Upload Files from Your App to the Cloud ........................................................................ 20 What Is the Amazon S3 TransferManager? ....................................................................... 20 Uploading a File .......................................................................................................... 20

    How to Store Objects in the Cloud .......................................................................................... 23 What is Amazon DynamoDB? ........................................................................................ 23 Integrating Amazon DynamoDB ..................................................................................... 23 Create a DynamoDB Table ............................................................................................ 24 Create a DynamoDB Client ........................................................................................... 24 Describe a Table .......................................................................................................... 25 Create a DynamoDB Object Mapper ............................................................................... 25 Save an Object ............................................................................................................ 26 Delete a Table Row ...................................................................................................... 27

    How to Stream Data for Real-Time Processing ......................................................................... 27 What is Amazon Kinesis? .............................................................................................. 27 Integrating Amazon Kinesis ........................................................................................... 27

    Document History ........................................................................................................................ 30

    iii

    AWS SDK for iOS 2.0 Developer Guide

  • What Is the AWS SDK for iOS?

    The AWS SDK for iOS is an open-source software development kit, distributed under an Apache Open Source license.The SDK for iOS provides a library, code samples, and documentation to help developers build connected mobile applications using AWS. This guide explains how to get started with the SDK for iOS, how to work with related mobile services such as Amazon Cognito and Amazon Mobile Analytics, and how to use Amazon Web Services effectively in a mobile app.

    Note This guide describes AWS SDK for iOS 2.0, which is currently in developer preview.

    About the AWS Mobile Services The AWS Mobile SDKs include client-side libraries for working with Amazon Web Services. These client libraries provide high-level, mobile-optimized interfaces to services such as Amazon DynamoDB, Amazon Simple Storage Service, and Amazon Kinesis.

    The Mobile SDKs also include clients for Amazon Cognito and Amazon Mobile Analytics—web services designed specifically for use by mobile developers.

    Amazon Cognito Amazon Cognito facilitates the delivery of scoped, temporary credentials to mobile devices or other un- trusted environments, and it uniquely identifies a device or user and supplies the user with a consistent identity throughout the lifetime of an application. The Cognito Sync service enables cross-device syncing of application-related user data. Cognito also persists data locally, so that it's available even if the device is offline.

    After you've set up the SDK, you can start using Amazon Cognito by following the instructions at How to Authenticate Users (p. 8) and How to Sync Profile Data (p. 15).

    Amazon Mobile Analytics Amazon Mobile Analytics lets you collect, visualize, and understand app usage for your mobile apps. Reports are available for metrics on active users, sessions, retention, in-app revenue, and custom events, and can be filtered by platform and date range.

    1

    AWS SDK for iOS 2.0 Developer Guide About the AWS Mobile Services

  • After you've set up the SDK, you can start using Amazon Mobile Analytics by following the instructions at How to Use Analytics in Your App (p. 18).

    About the SDK for