AWS Mobile SDK for Unity - Developer Guide

Developer Guide

AWS Mobile SDK for Unity

Copyright ? 2024 Amazon Web Services, Inc. and/or its a?liates. All rights reserved.

AWS Mobile SDK for Unity

Developer Guide

AWS Mobile SDK for Unity: Developer Guide

Copyright ? 2024 Amazon Web Services, Inc. and/or its a?liates. All rights reserved.

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 a?liated with, connected to, or

sponsored by Amazon.

AWS Mobile SDK for Unity

Developer Guide

Table of Contents

......................................................................................................................................................... vi

What is the AWS Mobile SDK for Unity? ....................................................................................... 1

Related guides and topics .......................................................................................................................... 1

Archived reference content ........................................................................................................................ 1

Compatibility ............................................................................................................................................ 2

Download the Mobile SDK for Unity .................................................................................................. 2

What's included in the Mobile SDK for Unity? .................................................................................. 2

Set Up the AWS Mobile SDK for Unity .......................................................................................... 3

Prerequisites .................................................................................................................................................. 3

Step 1: Download the AWS Mobile SDK for Unity ................................................................................ 3

Step 2: Con?gure the AWS Mobile SDK for Unity ................................................................................. 4

Create a Scene ......................................................................................................................................... 4

Set the Default AWS Service Region .................................................................................................. 4

Set Logging Information ....................................................................................................................... 4

Working with the link.xml ?le .............................................................................................................. 5

Step 3: Obtain the Identity Pool ID using Amazon Cognito ................................................................ 6

Next Steps ...................................................................................................................................................... 6

Getting Started with the AWS Mobile SDK for Unity ................................................................... 8

Amazon Cognito Identity ............................................................................................................................ 8

Amazon Cognito Sync ................................................................................................................................. 8

Using the CognitoSyncManager sample ............................................................................................. 8

Dynamo DB .................................................................................................................................................... 9

Using the DynamoDB Sample .............................................................................................................. 9

Mobile Analytics ......................................................................................................................................... 10

Con?guring Mobile Analytics ............................................................................................................. 10

Using the Mobile Analytics Sample .................................................................................................. 11

Amazon S3 ................................................................................................................................................... 11

Con?guring the S3 Default Signature .............................................................................................. 12

Using the S3 Sample ........................................................................................................................... 12

Amazon Simple Noti?cation Service ...................................................................................................... 13

AWS Lambda ............................................................................................................................................... 13

Amazon Cognito Identity .............................................................................................................. 14

What is Amazon Cognito Identity? ......................................................................................................... 14

Using a Public Provider to Authenticate Users ............................................................................... 14

iii

AWS Mobile SDK for Unity

Developer Guide

Using Developer Authenticated Identities ....................................................................................... 14

Amazon Cognito Sync ................................................................................................................... 15

Amazon Mobile Analytics .............................................................................................................. 16

Integrating Amazon Mobile Analytics .................................................................................................... 16

Create an App in the Mobile Analytics Console ............................................................................. 16

Integrate Mobile Analytics into Your App ....................................................................................... 16

Record Monetization Events ............................................................................................................... 17

Record Custom Events .........................................................................................................................

Recording Sessions ...............................................................................................................................

Amazon Simple Storage Service (S3) ...........................................................................................

Create and Con?gure an S3 Bucket .......................................................................................................

18

18

20

20

Create an S3 Bucket ............................................................................................................................. 20

Set Permissions for S3 ......................................................................................................................... 20

Upload Files from the Console .......................................................................................................... 21

(optional) Con?gure the Signature Version for S3 Requests ....................................................... 22

Create the Amazon S3 Client .................................................................................................................. 22

List Buckets .................................................................................................................................................. 22

List Objects .................................................................................................................................................. 23

Download an Object .................................................................................................................................. 23

Upload an Object ....................................................................................................................................... 24

Amazon DynamoDB ....................................................................................................................... 26

Integrating Amazon DynamoDB ............................................................................................................. 26

Create a DynamoDB Table ....................................................................................................................... 27

Create a DynamoDB Client ...................................................................................................................... 27

Describe a Table ......................................................................................................................................... 28

Save an Object ............................................................................................................................................ 29

Create a Book ............................................................................................................................................. 29

Retrieve a Book .......................................................................................................................................... 30

Update a Book ............................................................................................................................................ 31

Delete a Book ............................................................................................................................................. 31

Amazon Simple Noti?cation Service ............................................................................................ 33

Prerequisites .................................................................................................................................................. 3

Set Permissions for SNS ...................................................................................................................... 33

iOS Prerequisites ................................................................................................................................... 34

Android Prerequisites ........................................................................................................................... 34

Con?guring the Unity Sample App for iOS .......................................................................................... 34

iv

AWS Mobile SDK for Unity

Developer Guide

Unity Con?guration .............................................................................................................................. 34

iOS Con?guration .................................................................................................................................

SNS Con?guration ................................................................................................................................

Using Xcode ...........................................................................................................................................

Unity Sample (iOS) ...............................................................................................................................

Con?guring the Unity Sample App for Android ..................................................................................

Unity Con?guration ..............................................................................................................................

35

36

37

37

38

38

Android Con?guration .........................................................................................................................

SNS Con?guration ................................................................................................................................

Unity Sample (Android) .......................................................................................................................

AWS Lambda ..................................................................................................................................

38

39

40

41

Permissions .................................................................................................................................................. 41

Project Setup ............................................................................................................................................... 42

Set Permissions for AWS Lambda ..................................................................................................... 42

Create a New Execution Role ............................................................................................................. 42

Creating a Function in AWS Lambda ................................................................................................ 42

Create a Lambda Client ............................................................................................................................ 43

Create a Request Object ........................................................................................................................... 43

Invoke Your Lambda Function ................................................................................................................. 43

Troubleshooting ............................................................................................................................. 45

Ensure IAM Role Has Required Permissions ......................................................................................... 45

Using a HTTP Proxy Debugger ................................................................................................................ 46

v

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download