Engage Your Customers with Amazon SNS Mobile Push (MBL308) | AWS re:Invent 2013
Upcoming SlideShare
Loading in...5
×
 

Engage Your Customers with Amazon SNS Mobile Push (MBL308) | AWS re:Invent 2013

on

  • 5,462 views

Amazon SNS mobile push is a scalable, fully-managed, cross-platform mobile push notifications service. In this session, we show you how to implement a massively scalable notification system across ...

Amazon SNS mobile push is a scalable, fully-managed, cross-platform mobile push notifications service. In this session, we show you how to implement a massively scalable notification system across multiple platforms (including Apple, Google, and Kindle Fire devices). We cover common design patterns including the code you need, and we demonstrate live on stage just how fast and scalable SNS can be. Also hear from customers who have combined Amazon SNS with Amazon Redshift and Amazon DynamoDB to engage their own customers with precisely targeted messages.

Statistics

Views

Total Views
5,462
Slideshare-icon Views on SlideShare
5,356
Embed Views
106

Actions

Likes
5
Downloads
53
Comments
0

1 Embed 106

http://www.scoop.it 106

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Engage Your Customers with Amazon SNS Mobile Push (MBL308) | AWS re:Invent 2013 Engage Your Customers with Amazon SNS Mobile Push (MBL308) | AWS re:Invent 2013 Presentation Transcript

    • Engage Your Customers with Amazon SNS Mobile Push Constantin Gonzalez, Solutions Architect, Amazon, Germany Pablo Varela, Software Engineer, Plumbee November 15th, 2013 © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified, or distributed in whole or in part without the express consent of Amazon.com, Inc. Friday, November 15, 13
    • 65% of mobile apps are abandoned within 90 days. http://blog.flurry.com/bid/90743/App-Engagement-The-Matrix-Reloaded Friday, November 15, 13
    • “…understanding and improving user engagement is the new currency of doing business in the new digital world.” –Peter Farago, Flurry.com http://blog.flurry.com/bid/90743/App-Engagement-The-Matrix-Reloaded Friday, November 15, 13
    • Mobile push notifications engage customers when your app is not currently active. • Users opt-in to receive them • Delivered to a specific app on a specific device • Short messages: read, ignore, or acknowledge to launch the app Friday, November 15, 13
    • In this session, we’ll cover: • How push notifications work. • A simple, scalable, robust & cross-platform way to deliver push notifications that you can start using now. • A real-world example for sending massive amounts of targeted push notifications to mobile users. Friday, November 15, 13
    • Push Notifications Under the Covers Friday, November 15, 13
    • Your cloud application directs mobile push notifications to a specific app on a specific device Cloud App Friday, November 15, 13 Mobile Apps
    • Notifications are delivered via platform-specific push services, which keep connections with their devices. Platform Service Cloud App Friday, November 15, 13 Mobile Apps
    • Developers manage tokens for each device, and must proactively swap or disable them based on feedback. Token Feedback Platform Service Token Registration Friday, November 15, 13
    • Challenges Friday, November 15, 13
    • Each platform-specific push service works differently. Apple APNs Google GCM Amazon ADM Friday, November 15, 13 • Different APIs • Different Features • Different Feedback
    • Token Housekeeping Can be Complex Token Feedback Platform Service Token Registration Friday, November 15, 13 • Regularly connect to the platform service • Handle feedback for failed/ stale notifications • Blacklist tokens • Establish good reputation with platform services • etc.
    • Push notifications get even more complex as you scale to support millions of devices. Cloud App Platform Services Friday, November 15, 13 Mobile Apps
    • Amazon SNS Mobile Push Friday, November 15, 13
    • Amazon SNS Mobile Push is a managed, scalable, cross-platform push intermediary service. Apple Devices Google Devices Amazon SNS Mobile Push Friday, November 15, 13 Kindle Devices
    • You can send a distinct payload for each platform, or publish one common message for all platforms. Publish Apple Google Kindle Fire Friday, November 15, 13 Publish Kindle Fire Apple Google Kindle Fire Kindle Fire
    • You can publish unique messages to individual devices, or broadcast identical messages to many devices at once. Direct Publishing Broadcast with SNS Topics Publish Publish Publish Friday, November 15, 13 Publish
    • Amazon SNS consumes feedback from each platform and manages swapping and disabling tokens on your behalf. Token Feedback Cloud App Friday, November 15, 13 Amazon SNS Mobile Push Token Registration • Write to one stable endpoint per device • You can access the feedback, but you don’t have to do so in order to use Amazon SNS
    • Getting Started Friday, November 15, 13
    • Step 1: Write your mobile app • Use the mobile app platform’s push notification libraries as you normally would. Friday, November 15, 13
    • Step 2: Obtain Application Prerequisites • APNs: • Apple Push Notification service SSL certificate • Application Private Key • GCM: • API Key (Sender Auth Token) • ADM: • Client ID • Client secret Friday, November 15, 13
    • Step 3: Register Your Mobile App with AWS Amazon SNS Mobile Push Friday, November 15, 13
    • Step 4: Obtain a Token/Registration ID from the device • APNs: • Device Token • GCM: • Registration ID • ADM: Cloud App • Registration ID <e960d9b1…de43f6c0> Friday, November 15, 13
    • • For existing devices • Use the console for .csv import <e960d9b1…de43f6c0> arn:aws:sns:eu-west-1:12…1f Step 5: Add Token/Registration ID to Amazon SNS Cloud App Amazon SNS Mobile Push • Or use CreatePlatformEndpoint API • For future devices • Use a proxy server and the CreatePlatformEndpoint API • Or use the AWS token vending service and let devices register themselves • Receive an ARN back Friday, November 15, 13
    • Step 6a: Send Push Notifications via the Console Hello world! Friday, November 15, 13
    • Step 6b: Send Push Notifications via the API MyMac:~ glez$ python Python 2.7.2 (default, Oct 11 2012, 20:14:37) [GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import boto >>> import boto.sns >>> boto.sns.connect_to_region("eu-west-1").publish( ... message="Hello world!", ... target_arn="arn:aws:sns:eu-west-1:979463966312:endpoint/APNS_SANDBOX/ Push2reInvent/fc1234a1-67ef-4f62-b31a-ac320bf7631f") {u'PublishResponse': {u'PublishResult': {u'MessageId': u'1893fa9d-7478-5137be1d-b06928d999d0'}, u'ResponseMetadata': {u'RequestId': u'c3c26267-92af-50b3-b529-2893ce0e4854'}}} >>> Friday, November 15, 13
    • Step 7: Receive Friday, November 15, 13
    • User/Device management • Use CreatePlatformEndpoint to register new tokens/IDs along with user data • Use ListEndpointByPlatformApplication to discover registered endpoints • Manage ARNs and associated data in Amazon DynamoDB • Publish to individual ARNs, or • Use Amazon SNS topics for 1:many messaging • Coordinate publishing with Amazon SQS or Amazon SWF Friday, November 15, 13
    • Demo Friday, November 15, 13
    • Quick Review Amazon SNS Mobile Push Friday, November 15, 13 • Cross-platform push to Apple, Google and Amazon • Seamless scalability with durable, reliable deliveries • Easy token management • 1m free per month, and $1.00 per million thereafter
    • Pablo Varela, Software Engineer, Plumbee Friday, November 15, 13
    • Mirrorball Slots - Mobile Friday, November 15, 13
    • Mirrorball Slots - Mobile Friday, November 15, 13
    • Mirrorball Slots - Challenges Friday, November 15, 13
    • Our customers ask for notifications! “Some of us have very busy lives and can’t be checking the game 24/7. It would be great to get a notification when a challenge starts. Thanks!” Friday, November 15, 13
    • Use cases Retention / reactivation • Day 2, day 7 retention • active players (active in 7 days) • D7,D10,D14,D21,D28 reactivation • Challenge start/ends/redemption • New features/games Friday, November 15, 13 Targeted promotions • Spenders categorisation • Last spent • New user promos • Time-limited promo start/end
    • Design Goals • Easy to add new campaigns • Fine grained targeting • Scales linearly Friday, November 15, 13
    • Building blocks Data Collection Friday, November 15, 13 Targeting Mobile Push
    • Data Collection Friday, November 15, 13
    • Data Collection • Collect everything • There is not such a thing as too much data! • Targeting as effective as your data • Fine granularity depends on data analysis Friday, November 15, 13
    • Data Collection log actions log log Application Servers Friday, November 15, 13 Analytics Amazon SQS
    • Device Registration – Code example private String getArnForDeviceEndpoint( String platformApplicationArn, String deviceToken) { CreatePlatformEndpointRequest request = new CreatePlatformEndpointRequest() .withPlatformApplicationArn(platformApplicationArn) .withToken(deviceToken); CreatePlatformEndpointResult result = snsClient.createPlatformEndpoint(request); } return result.getEndpointArn(); Friday, November 15, 13
    • Device Registration – Logging private String registerEndpointForApplicationAndPlatform( final long plumbeeUid, String platformARN, String platformToken) { final String deviceEndpointARN = getArnForDeviceEndpoint(platformARN, platformToken); sqsLogger.queueMessage(new HashMap<String, Object>() {{ put("notification", "register"); put("plumbeeUid", plumbeeUid); put("provider", platformName); put("endpoint", deviceEndpointARN); }}, null); } return deviceEndpointARN; Friday, November 15, 13
    • Device Registration – Event example { "sId": "2fa5e687-c692-4c60-8bf9-19d3b3bef30f", "rId": "40f3aa74-1653-422f-a484-b98dbb32bda2", "timeStamp": 1381853084268, "testVariant": "", "m-mbs-app-service-version": "m-mbs-app-1381818956", "metadata": { "plumbeeUid": XXXXXXX, "notification": "register", "provider": "apns", "endpoint": "arn:aws:sns:us-east-1:300361537691:endpoint/APNS/ MIRRORBALL_SLOTS_CI/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX" } } Friday, November 15, 13
    • Data Collection (II) consume Analytics Amazon SQS Friday, November 15, 13 archive Apache Flume Amazon S3 Event Logs
    • Data Collection (III) Cluster consume KPIs update Amazon SNS Amazon Redshift Event Logs Friday, November 15, 13 Amazon EMR Amazon S3
    • User Targeting Friday, November 15, 13
    • User targeting • SQL queries against Amazon Redshift • That’s it! Friday, November 15, 13
    • User targeting – Query example -- Target all mobile users SELECT plumbee_uid, arn FROM mobile_user Friday, November 15, 13
    • User targeting – Query example (II) -- Target lapsed users (1 week lapse) SELECT plumbee_uid, arn FROM mobile_user WHERE last_play_time < (now - 7 days) Friday, November 15, 13
    • User targeting – Query example (III) -- All the users that spend between 6h and 9h UTC on -- Mondays and didn't spend in the last 7 days SELECT plumbee_uid, arn FROM user_spending_activity WHERE time_slice = 3 AND plumbee_uid IN ( SELECT plumbee_uid FROM user_metrics WHERE last_purchase_time < (now - 7d) Friday, November 15, 13
    • Mobile Push Friday, November 15, 13
    • Mobile Push – Code example SNS publish private void publishMessage(UserData userData, String jsonPayload) { amazonSNS.publish(new PublishRequest() .withTargetArn(userData.getEndpoint()) .withMessageStructure("json") .withMessage(jsonPayload)); } JSON payload { "default": "“The 5 day Halloween Challenge has started today! Touch to play now!”", "APNS": "{"aps" : {"alert":"Halloween Challenged has started!"","sound":"default" },"id":"XXXX ","tag":"challenge-start" }" } Friday, November 15, 13
    • Mobile Push • Amazon SWF for orchestration • Amazon Redshift for targeting • Amazon SNS for the actual push Friday, November 15, 13
    • Mobile Push - Scheduling query Scheduling Friday, November 15, 13 query Publish Service Amazon SWF
    • Mobile Push - Targeting query query Amazon EC2 Worker Amazon SWF (Segmentation) Friday, November 15, 13 target users Amazon Redshift Amazon S3
    • Mobile Push - Processing batch 1 - N batch N - M partition publish partition push push publish Amazon EC2 Amazon SWF Children workflows Read data + push Decider (Batch Processing) Friday, November 15, 13 End User
    • Mobile Push - Reporting example The following message has been sent to NNNNNN devices in m min, ss sec: ““The 5 day Halloween Challenge has started today! Touch to play now!”” Targeting query: SELECT m_arn.plumbeeui, DISTINCT(m_arn.endpoint) FROM mobile.lu_user m_user, mobile.lu_notifications_arn m_arn WHERE m_user.plumbeeuid = m_arn.plumbeeuid AND country_code IN (:america) GROUP BY m_arn.endpoint Workflow Execution Stats * * * * number number number number of of of of devices targeted: NNNNNN notifications sent: NNNNNN notifications that failed (excluding disabled devices): 0 disabled devices: NNNN Click here for workflow execution details. Friday, November 15, 13
    • Day 2 retention - No Push vs Push Without Push 40 With Push 30 20 10 0 Day 1 Friday, November 15, 13 Final Day Redemption Day
    • Summary • Collect and analyze data: Amazon SQS, Amazon S3, Amazon EMR, Apache Flume, Amazon Redshift • Targeting: SQL queries • Mobile Push with Amazon SNS • Orchestration with Amazon SWF Friday, November 15, 13
    • More Information • Open Source projects • https://github.com/plumbee • Plumbee Engineering Blog • http://bit.ly/1hqWBD4 • Email • pablo.varela@plumbee.co.uk Friday, November 15, 13
    • Extensive SDK and IDE support enables you to build applications tailored to your language or platform. SDKs for your preferred platform and language… Android iOS Java nodeJS .NET …integrated into your preferred IDE Eclipse Friday, November 15, 13 Visual Studio CLI Powershell PHP Python Ruby
    • More Information • Amazon SNS Detail Page and Docs • http://amzn.to/179ee7r Amazon SNS Mobile Push • Getting Started + Sample Apps • http://amzn.to/15rs1DV • Email • aws-sns-mobile-push@amazon.com Friday, November 15, 13
    • We hope your mobile app never gets abandoned! Friday, November 15, 13
    • Please give us your feedback on this presentation MBL308 As a thank you, we will select prize winners daily for completed surveys! Friday, November 15, 13 Thank You
    • Developers use intermediaries to abstract platform-specific APIs and manage tokens for millions of apps. Push Intermediary Friday, November 15, 13
    • Developers use intermediaries to abstract platform-specific APIs and manage tokens for millions of apps. Abstraction so your app can engage users on any platform Manage tokens to ensure messages are delivered reliably Friday, November 15, 13 Operational complexity Scalability takes work Cost – even though the platform services themselves are free
    • SNS offers easy scalability, so you can just start sending more messages as your app achieves scale. • Go from a few messages to hundreds of millions • Go from a few devices to hundreds of millions ...without provisioning, configuring or managing ...without sacrificing reliable, durable delivery Friday, November 15, 13
    • You can get started for free. • 1 Million Free per Month • 1 million publishes + 1 million mobile push notifications • $1.00 per Million Thereafter • $0.50 per million publishes + $0.50 per million mobile push deliveries • When you broadcast with SNS Topics, your effective price can be lower Friday, November 15, 13