5. Mobile SDK
Cognito
• Unique Identity
• Scoped, temp credentials
• Cross Device Sync
S3
• Partitioning & Parallel transmission
• Retransmits, handles intermittent
networks
DDB
• ORM interface
• Conditional/Batch writes
• “low-level client”
API Gateway & Lambda
Mobile Analytics
• Standard events
• Custom events
• Persist and batch send
Kinesis
• Store and serialize
• Streams or Firehose
• Send Payloads in batch
• Records sent if devices go offline
Can just use REST
• SDKs on GitHub
Swift
• Compatible - Use in
your project!
6. “AWS has what I need, but…I am new here”
1. Which services should I use? 2. How do I connect them?
Identity Provider SDKs
+
<Example>
Login screen & integration code
+
SDK
7. Mobile Hub as a Starting Point
• Generates Working Code to Explore
• Introduction to AWS SDK features and functions
• iOS and Android interaction with AWS Services
8. AWS Mobile Hub (beta)
1. Single integrated console
2. Pre-built features
3. Auto-provisioned services
4. Auto-generated app
Result: Build Apps on AWS in Minutes
10. +
Feature
Server-side validation/persistence
AWS Service
Code generation
Testing
Authentication
Survey files (json)
State and sync between devices
Analytics
Device Farm
Cognito Datastore
Mobile Analytics
100% Serverless
Recap: Mobile Hub Sample Architecture
Lambda + DynamoDB
Mobile Hub
Cognito (Facebook)
S3
1.
2.
3.
4.
5.
6.
7.
11. Gather: Mobile Analytics
SDK
(Android, iOS, JavaScript, Unity, Xamarin)
REST API
Amazon
MobileAnalytics
Daily/Monthly Active Users
Sessions
Sticky Factor
In-app Revenue
Lifetime Value (LTV)
Retention
…. and more
(Pre-defined metrics with a few lines of code)
Amazon
S3
Amazon
Redshift
Amazon
DynamoDB
Amazon
EMR
Amazon Machine
Learning
Amazon
API
Gateway
Amazon
Elasticsearch
Service
Amazon
RDS
12. Assume a Role with Cognito
Create an instance of your
Mobile Analytics Application
Create->Record->Submit Events
Submitting Events: Android Example
13. API Gateway
API Gateway
AWS Lambda
Any other publicly
accessible endpoint
Amazon EC2
API Gateway Generated SDK
- Signed Requests
Cognito:
User Pools + Identity
22. Cordova
Formerly known as Phonegap
Create Mobile Apps with HTML, CSS,
JavaScript
Extended via plugins
WebView intermediary for
rendering/communicating with platform
Ionic
• UI Framework build on Cordova using
Angular
23. Using AWS Services from Cordova
1. Download & include aws-sdk.min.js
2. Reference in Cordova’s index.html
3. Grant AWS endpoints access
4. Call AWS SDK functions from index.js
• Start with Cognito in onDevice
AWS Mobile SDKs: Libraries with high-level interfaces which are optimized for mobile networks and platforms to access AWS services.
Cognito
- Facilitates scoped, temp credentials for accessing AWS services securely and assigns unique identification to users or devices throughout the lifetime of an application.
- Associate or join Public or Custom identity providers with Cognito assigned identification to control access to AWS resources
- Synchronizes key/value datasets across devices based on triggers and persists data securely to local storage
S3
- Breaks up files to transfer into multiple pieces for parallel transmission, retransmits and handles intermittent networks
DDB
- Provides an abstract ORM interface to DynamoDB items and attributes to easily read & write to a persistent NoSQL
- Conditional writes & batch writes use a “low-level client” (direct message send/method call)
Lambda
- Invoke Lambda functions with a custom class method
Mobile Analytics
- Persist standard (user sessions, retention, etc.) and custom MA events locally and send in batch for efficient device usage
Kinesis
- Store and serialize data payloads for transmission to Kinesis Streams or Kinesis Firehose (separate classes)
- PutRecord payloads are stored on disk to be sent in batch for more efficient network usage & battery life
- Ensures records are sent if devices go offline through application lifecyle
Note that the services on the left are a “Pull Model”
“Push Model” also includes SNS
Note how you can use the Mobile Analytics options to either send events over all networks or just WiFi
Microservices and Serverless
Note that messages to device and from AWS to provider requires authn/authz that’s why we need Certs, API keys, etc.
#3 will also need to add amazonaws.com to config.xml in Cordova project
YOURID is the Google Cloud Messaging Project ID
Modify index.js with an event listener for the GCM registration ID or iOS device token
Note we’re also using Push Notifications with React Native