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.
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Â
Engage Your Customers with Amazon SNS Mobile Push (MBL308) | AWS re:Invent 2013
1. 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
2. 65% of mobile apps are abandoned
within 90 days.
http://blog.flurry.com/bid/90743/App-Engagement-The-Matrix-Reloaded
Friday, November 15, 13
3. ââŚ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
4. 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
5. 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
7. Your cloud application directs mobile push
notifications to a specific app on a specific device
Cloud App
Friday, November 15, 13
Mobile Apps
8. Notifications are delivered via platform-specific
push services, which keep connections with their
devices.
Platform
Service
Cloud App
Friday, November 15, 13
Mobile Apps
9. 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
11. Each platform-specific push service works
differently.
Apple APNs
Google GCM
Amazon ADM
Friday, November 15, 13
⢠Different APIs
⢠Different Features
⢠Different Feedback
12. 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.
13. Push notifications get even more complex as you
scale to support millions of devices.
Cloud App
Platform Services
Friday, November 15, 13
Mobile Apps
15. 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
16. 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
17. 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
18. 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
20. Step 1: Write your mobile app
⢠Use the mobile app platformâs
push notification libraries as you
normally would.
Friday, November 15, 13
21. 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
22. Step 3: Register Your Mobile App with AWS
Amazon SNS
Mobile Push
Friday, November 15, 13
23. 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
24. ⢠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
25. Step 6a: Send Push Notifications via the Console
Hello world!
Friday, November 15, 13
26. 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
28. 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
30. 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
35. 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
36. 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
37. Design Goals
⢠Easy to add new campaigns
⢠Fine grained targeting
⢠Scales linearly
Friday, November 15, 13
40. 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
48. User targeting
⢠SQL queries against Amazon Redshift
⢠Thatâs it!
Friday, November 15, 13
49. User targeting â Query example
-- Target all mobile users
SELECT plumbee_uid, arn
FROM mobile_user
Friday, November 15, 13
50. 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
51. 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
57. 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
58. 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
59. 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
60. 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
61. 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
62. 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
63. 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
64. We hope your mobile app never
gets abandoned!
Friday, November 15, 13
65. 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
66. Developers use intermediaries to abstract platform-specific APIs and
manage tokens for millions of apps.
Push Intermediary
Friday, November 15, 13
67. 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
68. 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
69. 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