Se ha denunciado esta presentación.
Utilizamos tu perfil de LinkedIn y tus datos de actividad para personalizar los anuncios y mostrarte publicidad más relevante. Puedes cambiar tus preferencias de publicidad en cualquier momento.

Deep-Dive: Building Native iOS and Android Application with the AWS Mobile SDK

5.133 visualizaciones

Publicado el

by John Burry, Sr. Manager of Solution Architecture, AWS

  • Sé el primero en comentar

Deep-Dive: Building Native iOS and Android Application with the AWS Mobile SDK

  1. 1. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved. John Burry, Sr Mgr AWS Solutions Architecture October 25, 2016 Deep-Dive: Building Native iOS and Android Application with the AWS Mobile SDK
  2. 2. Native Apps vs Web Apps
  3. 3. Fully Integrated AWS Mobile SDK • Cross-Service authentication mechanism • Handle intermittent network connections • Android, iOS, Fire OS, Unity, JavaScript • Reduced memory footprint, battery impact, etc.
  4. 4. Native Android 1. Import JARs 2. Gradle 3. Maven iOS 1. Import .framework files 2. Cocoapods 1. sudo gem cocoapods 2. 3. pod install 4. *.xcworkspace not *xcodeproj
  5. 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. 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. 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. 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. 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. 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. 12. Assume a Role with Cognito Create an instance of your Mobile Analytics Application Create->Record->Submit Events Submitting Events: Android Example
  13. 13. API Gateway API Gateway AWS Lambda Any other publicly accessible endpoint Amazon EC2 API Gateway Generated SDK - Signed Requests Cognito: User Pools + Identity
  14. 14. API Gateway generated SDK
  15. 15. Provider (APNS, GCM, MPNS,…) Token Request Amazon SNS SNS Platform Application “Token” Platform Endpoint - Upload Certificates, API Keys, etc. Upload Token - AKA “Create Platform Endpoint” - Client code in App Delegate, etc. Lifecycle of Push Notifications
  16. 16. Fine-grained control Send to Mobile Analytics Sync Datasets across devices Add Token to SNS Add email/phone to SNS
  17. 17. Provider (APNS, GCM, MPNS,…) Amazon SNS Platform Application “Token” Platform Endpoint Upload Token - AKA “Create Platform Endpoint” Add Email to Topic Add Phone to Topic Alternative Options Amazon API Gateway Amazon Cognito User Pool AWS Lambda Topic Workflow Triggers /myapi/register Custom Authorizers
  18. 18. Cognito Datasets
  19. 19. Cognito Dataset Push Sync - Dataset changes pushed to devices via SNS Events - Execute Lambda functions when Datasets sync Streams - Dataset changes sent to Kinesis
  20. 20. DynamoDB Access via Cognito assigned Role Databases Relational Create interfaces - REST/GraphQL/JSON-API - API Gateway, ELB/ALB - Common: ASG behind ELB using RDS Multi-AZ - Platform HTTP calls - iOS: NSURLConnection, NSURLSession, etc. - Android: HttpClient(), HttpGet(),etc.
  21. 21. Hybrid Apps
  22. 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. 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
  24. 24. Cognito & Cordova
  25. 25. Push Notifications and Cordova Yes you can initiate SNS-based Push to Cordova! ANDROID: $cordova plugin add phonegap-plugin-push –variable SENDER_ID="YOURID" iOS: $cordova plugin add phonegap-plugin-push
  26. 26. React Native AWS Published SDK available • AWSLABS native Can easily add in AWS Native SDKs
  27. 27. Customizing React Native with AWS SDKs 1. Import Native AWS SDK & Bridging Modules 2. Create Singleton
  28. 28. Customizing React Native with AWS SDKs 3. Initialize in JavaScript 3. Add/Invoke methods
  29. 29. Thank You!