engage your users with amazon sns mobile push (now with broadcast) - jinesh varia, jon turow

72
Amazon SNS Mobile Push Deep Dive Jinesh Varia 10/10/2014

Upload: amazon-web-services

Post on 27-Nov-2014

254 views

Category:

Documents


1 download

DESCRIPTION

Amazon Simple Notification Service (Amazon SNS) is a fast, flexible, fully managed push messaging service. Amazon SNS makes it simple and cost-effective to push notifications to Apple, Google, Fire OS, and Windows devices, as well as Android devices in China with Baidu Cloud Push. You can also use SNS to push notifications to internet connected smart devices, as well as other distributed services.

TRANSCRIPT

Page 1: Engage your users with Amazon SNS Mobile Push (Now with Broadcast) - Jinesh Varia, Jon Turow

Amazon SNS Mobile Push Deep Dive

Jinesh Varia

10/10/2014

Page 2: Engage your users with Amazon SNS Mobile Push (Now with Broadcast) - Jinesh Varia, Jon Turow

Authenticate users

Authorize access

Analyze User Behavior

Store and share media

Synchronize data

Deliver media

Store shared data

Stream real-time dataTrack Retention

Send push notifications

Manage users and identity providers

Securely access cloud resources

Sync user prefs across devices

Track active users, engagement

Manage funnels, Campaign performances

Store user-generated photosMedia and share them

Automatically detect mobile devicesDeliver content quickly globally

Bring users back to your app by sendingmessages reliably

Store and query fast NoSQL dataacross users and devices

Collect real-time clickstream logs and take actions quickly

Your Mobile

App

Page 3: Engage your users with Amazon SNS Mobile Push (Now with Broadcast) - Jinesh Varia, Jon Turow

Introducing AWS Mobile Services

Amazon Cognito Amazon Mobile AnalyticsAmazon SNS Mobile Push

Kinesis Connector DynamoDB Connector S3 Connector SQS ConnectorSES Connector

AWS Global Infrastructure (10 Regions, Availability Zones, 51 Edge Locations)

Core Building Block Services

Mobile Optimized Connectors

Mobile Optimized Services

Your Mobile App, Game or Device App

AWS Mobile SDK, API Endpoints, Management Console

Compute Storage Networking Analytics Databases

Integrated SDK

Page 4: Engage your users with Amazon SNS Mobile Push (Now with Broadcast) - Jinesh Varia, Jon Turow

Cross-platform, Optimized for Mobile

Amazon Cognito Amazon Mobile AnalyticsAmazon SNS Mobile Push

Kinesis Connector DynamoDB Connector S3 Connector SQS ConnectorSES Connector

User identity & data synchronizationservice

Store any NoSQL data and also map mobile OS specific objects to DynamoDB tables

Fast cross-platformAnalytics & reportingService

Powerful Cross-platformPush notification service

Recorder that can handle intermittent network connection

Easily upload, download to S3 and also pause, resume, and cancel these operations

Send email reliably from device

Access distributed buffering and queuing service

Page 5: Engage your users with Amazon SNS Mobile Push (Now with Broadcast) - Jinesh Varia, Jon Turow

Fully Integrated AWS Mobile SDK

• Common authentication mechanism across all services

• Automatically handle intermittent network connections

• Cross-platform Support: Android, iOS, Fire OS

• Native SDKs optimized for Mobile OS, for example, uses the local offline caching architecture

• Reduced memory footprint; Pick and choose the service jars you need

Page 6: Engage your users with Amazon SNS Mobile Push (Now with Broadcast) - Jinesh Varia, Jon Turow

Authenticate users

Authorize access

Analyze User Behavior

Store and share media

Synchronize data

Deliver media

Store shared data

Stream real-time dataTrack Retention

Send push notifications

Manage users and identity providers

Securely access cloud resources

Sync user prefs across devices

Track active users, engagement

Manage funnels, Campaign performances

Store user-generated photosMedia and share them

Automatically detect mobile devicesDeliver content quickly globally

Bring users back to your app by sendingmessages reliably

Store and query fast NoSQL dataacross users and devices

Collect real-time clickstream logs and take actions quickly

Your Mobile

App

Page 7: Engage your users with Amazon SNS Mobile Push (Now with Broadcast) - Jinesh Varia, Jon Turow

Authenticate users

Authorize access

Analyze User Behavior

Store and share media

Synchronize data

AWS Mobile SDK

Amazon Mobile Analytics

Deliver media

Amazon Cognito (Sync)

AWS Identity and Access Management

Amazon Cognito(Identity Broker)

Amazon S3Transfer Manager

Amazon CloudFront(Device Detection)

Store shared dataAmazon DynamoDB(Object Mapper)

Stream real-time dataAmazon Kinesis(Recorder)

Track RetentionAmazon Mobile Analytics

Send push notificationsAmazon SNS Mobile Push

Your Mobile

App

Page 8: Engage your users with Amazon SNS Mobile Push (Now with Broadcast) - Jinesh Varia, Jon Turow

Amazon SNS Mobile Push

Highly Scalable

Send one identical messages to multiple

providers at once

Single API for Cross-Platform Notifications

Gateways

Broadcast

“managed, scalable, cross-platform push intermediary service”

Apple, Google Amazon, Windows, Baidu CP all

fully integrated

Scales from zero to billions of notifications a day within a few days

iOS

Page 9: Engage your users with Amazon SNS Mobile Push (Now with Broadcast) - Jinesh Varia, Jon Turow

65% of mobile apps are abandoned within 90 days.

http://blog.flurry.com/bid/90743/App-Engagement-The-Matrix-Reloaded

Page 10: Engage your users with Amazon SNS Mobile Push (Now with Broadcast) - Jinesh Varia, Jon Turow

“…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

Page 11: Engage your users with Amazon SNS Mobile Push (Now with Broadcast) - Jinesh Varia, Jon Turow

Mobile push notifications engage customers when your app is not currently active.

Page 12: Engage your users with Amazon SNS Mobile Push (Now with Broadcast) - Jinesh Varia, Jon Turow

Mobile push notifications engage customers when your app is not currently active.

• Right message

• Right user

• Right time

Page 13: Engage your users with Amazon SNS Mobile Push (Now with Broadcast) - Jinesh Varia, Jon Turow

Discussion Topics

• Engaging Your Users with Push Notifications

• Quick Intro to Mobile Push and Simple Notification Service (SNS)

• Getting Started with SNS

Page 14: Engage your users with Amazon SNS Mobile Push (Now with Broadcast) - Jinesh Varia, Jon Turow

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

Page 15: Engage your users with Amazon SNS Mobile Push (Now with Broadcast) - Jinesh Varia, Jon Turow

Push notifications drive user engagement

“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.”

- Plumbee gaming customer

Page 16: Engage your users with Amazon SNS Mobile Push (Now with Broadcast) - Jinesh Varia, Jon Turow

Some Use Cases

Broadcast Direct Closed Loop

Identical messages to many at once

Unique messages to individual customers

Targeted and optimized with analytics

Page 17: Engage your users with Amazon SNS Mobile Push (Now with Broadcast) - Jinesh Varia, Jon Turow

Some Use Cases

Broadcast Direct Closed Loop

Identical messages to many at once

Unique messages to individual customers

Targeted and optimized with analytics

Page 18: Engage your users with Amazon SNS Mobile Push (Now with Broadcast) - Jinesh Varia, Jon Turow

Broadcast Push Notification Use Cases

• New features/content/games

• Promotion start/ends/redemption

• Active players (active in 7 days)

• Newly inactive players

• Segmentation (geo, spend, others..)

Page 19: Engage your users with Amazon SNS Mobile Push (Now with Broadcast) - Jinesh Varia, Jon Turow

Broadcast Push Notification Use Cases

• “New episode available now!”

• “Halloween challenge starts today.”

• “Keep the streak going.”

• “Smokey the bear misses you!”

• “New Jetpack, on sale today!”

Page 20: Engage your users with Amazon SNS Mobile Push (Now with Broadcast) - Jinesh Varia, Jon Turow

Some Use Cases

Broadcast Closed Loop

Identical messages to many at once

Targeted and optimized with analytics

Direct

Unique messages to individual customers

Page 21: Engage your users with Amazon SNS Mobile Push (Now with Broadcast) - Jinesh Varia, Jon Turow

Direct Push Notification Use Cases

• Messaging

• Turn-based activities

• Events

• User lifecycle

• Administrative

Page 22: Engage your users with Amazon SNS Mobile Push (Now with Broadcast) - Jinesh Varia, Jon Turow

Direct Push Notification Use Cases

• “Jon invited you to a game.”

• “It’s your turn to play.”

• “You now have full lives.”

• “Welcome to the game!”

• “Your subscription is ending.”

Page 23: Engage your users with Amazon SNS Mobile Push (Now with Broadcast) - Jinesh Varia, Jon Turow

Some Use Cases

Broadcast

Identical messages to many at once

Direct

Unique messages to individual customers

Closed Loop

Targeted and optimized with analytics

Page 24: Engage your users with Amazon SNS Mobile Push (Now with Broadcast) - Jinesh Varia, Jon Turow

Closed Loop Push Notification Use Cases

• Broadcast push notifications

• Direct push notifications

Page 25: Engage your users with Amazon SNS Mobile Push (Now with Broadcast) - Jinesh Varia, Jon Turow

Closed Loop Push Notification Use Cases

• Different messages

• Different frequencies

• Different segments

• Different times of day

• Different points in the lifecycle

Page 26: Engage your users with Amazon SNS Mobile Push (Now with Broadcast) - Jinesh Varia, Jon Turow

Some Use Cases

Broadcast Direct Closed Loop

Identical messages to many at once

Unique messages to individual customers

Targeted and optimized with analytics

Page 27: Engage your users with Amazon SNS Mobile Push (Now with Broadcast) - Jinesh Varia, Jon Turow

Consider push notifications as calls-to-action: what messages will most effectively reengage your customers?

Page 28: Engage your users with Amazon SNS Mobile Push (Now with Broadcast) - Jinesh Varia, Jon Turow
Page 29: Engage your users with Amazon SNS Mobile Push (Now with Broadcast) - Jinesh Varia, Jon Turow

Mirrorball Slots - Mobile

Page 30: Engage your users with Amazon SNS Mobile Push (Now with Broadcast) - Jinesh Varia, Jon Turow

Mirrorball Slots - Challenges

Page 31: Engage your users with Amazon SNS Mobile Push (Now with Broadcast) - Jinesh Varia, Jon Turow

Mirrorball Slots - Challenges

Push 1: Initial Offer

Push 2: Final Offer

Push 3: Offer Redemption

Page 32: Engage your users with Amazon SNS Mobile Push (Now with Broadcast) - Jinesh Varia, Jon Turow

Push notifications drive user engagement

Without Push With Push

Real User Engagement Comparison

Initial Offer

Final Offer

Offer Redemption Day

Page 33: Engage your users with Amazon SNS Mobile Push (Now with Broadcast) - Jinesh Varia, Jon Turow

Discussion Topics

• Engaging Your Users with Push Notifications

• Quick Intro to Mobile Push and Simple Notification Service (SNS)

• Getting Started with SNS

Page 34: Engage your users with Amazon SNS Mobile Push (Now with Broadcast) - Jinesh Varia, Jon Turow

Your cloud application directs mobile push notifications to a specific app on a specific device

Cloud App Mobile Apps

Page 35: Engage your users with Amazon SNS Mobile Push (Now with Broadcast) - Jinesh Varia, Jon Turow

Notifications are delivered via platform-specific push services, which keep connections with their devices.

Cloud App Mobile Apps

Platform Service

Page 36: Engage your users with Amazon SNS Mobile Push (Now with Broadcast) - Jinesh Varia, Jon Turow

Developers manage tokens for each device, and must proactively swap or disable them based on feedback.

Platform Service

Token Registration

Token Feedback

Page 37: Engage your users with Amazon SNS Mobile Push (Now with Broadcast) - Jinesh Varia, Jon Turow

Each platform-specific push service works differently.

Apple APNS

Google GCM

Amazon ADM

• Different APIs

• Different Features

• Different Feedback

Page 38: Engage your users with Amazon SNS Mobile Push (Now with Broadcast) - Jinesh Varia, Jon Turow

Push notifications get even more complex as you scale to support millions of devices.

Cloud App

Platform Services Mobile Apps

Page 39: Engage your users with Amazon SNS Mobile Push (Now with Broadcast) - Jinesh Varia, Jon Turow

Developers build custom intermediaries to abstract platform-specific APIs and manage tokens for millions of apps.

Mobile AppsPush Intermediary

Page 40: Engage your users with Amazon SNS Mobile Push (Now with Broadcast) - Jinesh Varia, Jon Turow

Developers build custom 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

Operational complexity

Scalability takes work

Cost – even though the platform services themselves are free

Page 41: Engage your users with Amazon SNS Mobile Push (Now with Broadcast) - Jinesh Varia, Jon Turow

Amazon SNS Mobile Push is a managed, scalable, cross-platform push intermediary service.

Amazon SNSCross-

platform Mobile Push

Apple APNS

Google GCM

Amazon ADM

Windows WNS and MPNS

Baidu CP

Industry’s First!

New!

Android Phones and Tablets

Apple iPhones and iPads

Kindle Fire Devices

Android Phones and Tablets in China

iOS

Windows Desktop and Windows Phone Devices

Page 42: Engage your users with Amazon SNS Mobile Push (Now with Broadcast) - Jinesh Varia, Jon Turow

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

New features: • Time to Live (TTL)• Message Attributes• Large Topics• iOS8

Page 43: Engage your users with Amazon SNS Mobile Push (Now with Broadcast) - Jinesh Varia, Jon Turow

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

Page 44: Engage your users with Amazon SNS Mobile Push (Now with Broadcast) - Jinesh Varia, Jon Turow

Discussion Topics

• Engaging Your Users with Push Notifications

• Quick Intro to Mobile Push and Simple Notification Service (SNS)

• Getting Started with SNS

Page 45: Engage your users with Amazon SNS Mobile Push (Now with Broadcast) - Jinesh Varia, Jon Turow

SNS publishes notifications on your behalf using the credentials you obtain from each push service.

Apple APNS

Google GCM

Amazon ADM

Amazon SNSMobile Push

Page 46: Engage your users with Amazon SNS Mobile Push (Now with Broadcast) - Jinesh Varia, Jon Turow

SNS encapsulates each device token inside an Amazon Resource Name (ARN) endpoint.

Apple APNS

Google GCM

Amazon ADM

Amazon SNSMobile Push

ARN 1

Token A

ARN 2

Token B

ARN 3

Token C

Page 47: Engage your users with Amazon SNS Mobile Push (Now with Broadcast) - Jinesh Varia, Jon Turow

Once you register a device with SNS, SNS proactively consumes feedback about the corresponding token from the push service.

Amazon SNSMobile Push

Token Registration

Token Feedback

Cloud App

You can access the underlying tokens and feedback, but you don’t have to do so in order to use SNS.

Page 48: Engage your users with Amazon SNS Mobile Push (Now with Broadcast) - Jinesh Varia, Jon Turow

ARN endpoints remain stable, even if the underlying token is swapped or disabled.

Apple APNS

Google GCM

Amazon ADM

Amazon SNSMobile Push

ARN 1

Token A

ARN 2

Token B

ARN 3

Token C

Token X

Token Y

Page 49: Engage your users with Amazon SNS Mobile Push (Now with Broadcast) - Jinesh Varia, Jon Turow

ARN endpoints behave the same no matter which mobile platform they address.

Amazon SNSMobile Push

ARN 1

Token A

ARN 2

Token B

ARN 3

Token C

Page 50: Engage your users with Amazon SNS Mobile Push (Now with Broadcast) - Jinesh Varia, Jon Turow

You can publish unique messages to individual devices, or broadcast identical messages to many devices at once.

Publish

Publish

Publish

Publish

Direct Publishing Broadcast with SNS Topics

Page 51: Engage your users with Amazon SNS Mobile Push (Now with Broadcast) - Jinesh Varia, Jon Turow

Grouping users by SNS Topic

Geography Activity Product

US – West Coast Daily Actives Flapping Bird Rio

Interest Tier Segment

49ers Premium Top 100 Players

Page 52: Engage your users with Amazon SNS Mobile Push (Now with Broadcast) - Jinesh Varia, Jon Turow

Apple

Kindle Fire

Kindle Fire

Google

Publish

Apple

Kindle Fire

Kindle Fire

Google

Publish

SNS can reformat your message for each mobile platform, or you can specify platform-specific payloads.

Publish Once, Deliver Anywhere Specify Platform-Specific Payloads

Page 53: Engage your users with Amazon SNS Mobile Push (Now with Broadcast) - Jinesh Varia, Jon Turow

So let’s get started.

Page 54: Engage your users with Amazon SNS Mobile Push (Now with Broadcast) - Jinesh Varia, Jon Turow

Step 1: Write your mobile app

• Use the mobile app platform’s push notification libraries as you normally would.

Page 55: Engage your users with Amazon SNS Mobile Push (Now with Broadcast) - Jinesh Varia, Jon Turow

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

Page 56: Engage your users with Amazon SNS Mobile Push (Now with Broadcast) - Jinesh Varia, Jon Turow

Step 3: Register Your Mobile App with AWS

Amazon SNSMobile Push

Page 57: Engage your users with Amazon SNS Mobile Push (Now with Broadcast) - Jinesh Varia, Jon Turow

Step 4: Obtain a Token/Registration ID from the device

• APNs:• Device Token

• GCM:• Registration ID

• ADM:• Registration ID

CloudApp

<e960d9b1…de43f6c0>

Page 58: Engage your users with Amazon SNS Mobile Push (Now with Broadcast) - Jinesh Varia, Jon Turow

Step 5: Add Token/Registration ID to Amazon SNS

• For existing devices• Use the console for .csv import

• 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

Amazon SNSMobile Push

CloudApp

<e

96

0d

9b1

…d

e4

3f6

c0>

arn:aws:sns:eu-west-1:12…1f

Page 59: Engage your users with Amazon SNS Mobile Push (Now with Broadcast) - Jinesh Varia, Jon Turow

private String getArnForDeviceEndpoint( String platformApplicationArn, String deviceToken) {

CreatePlatformEndpointRequest request = new CreatePlatformEndpointRequest() .withPlatformApplicationArn(platformApplicationArn) .withToken(deviceToken);

CreatePlatformEndpointResult result = snsClient.createPlatformEndpoint(request);

return result.getEndpointArn();}

Device Registration – Code example

Page 60: Engage your users with Amazon SNS Mobile Push (Now with Broadcast) - Jinesh Varia, Jon Turow

Step 6a: Send Push Notifications via the Console

Hello world!

Page 61: Engage your users with Amazon SNS Mobile Push (Now with Broadcast) - Jinesh Varia, Jon Turow

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-5137-be1d-b06928d999d0'}, u'ResponseMetadata': {u'RequestId': u'c3c26267-92af-50b3-b529-2893ce0e4854'}}}

>>>

Page 62: Engage your users with Amazon SNS Mobile Push (Now with Broadcast) - Jinesh Varia, Jon Turow

Step 7: Receive and Close the Loop

Page 63: Engage your users with Amazon SNS Mobile Push (Now with Broadcast) - Jinesh Varia, Jon Turow

Amazon SNSMobile Push

Quick Review:• Cross-platform push to

Apple, Google, Amazon, Windows and Baidu• 1m free per month, and $1.00 per million thereafter• Seamless scalability with durable, reliable deliveries• Easy token management

For More Information:• SNS Detail Page and Docs: http://amzn.to/179ee7r • Getting Started + Sample Apps: http://amzn.to/15rs1DV• Email: [email protected]

Page 64: Engage your users with Amazon SNS Mobile Push (Now with Broadcast) - Jinesh Varia, Jon Turow

Thank You!

Jinesh Varia, Stefano Buliani@jinman, @sapessi

Page 65: Engage your users with Amazon SNS Mobile Push (Now with Broadcast) - Jinesh Varia, Jon Turow

Appendix: Server side Mobile Push

Page 66: Engage your users with Amazon SNS Mobile Push (Now with Broadcast) - Jinesh Varia, Jon Turow

Let’s Build This System

DevApple iPhone

iOS SDKwith XCode

PHP Push Server App with web UI

Elastic Beanstalk Container

Notification

Mac

Amazon SNS

Google

AWS Cloud

Android

Notification

Page 67: Engage your users with Amazon SNS Mobile Push (Now with Broadcast) - Jinesh Varia, Jon Turow

1) Register Developer, Device & App Identities with Apple

DevApple iPhone

Mac

Page 68: Engage your users with Amazon SNS Mobile Push (Now with Broadcast) - Jinesh Varia, Jon Turow

2) Load Client App on iPhone with XCode

DeviPhone

iOS SDKwith XCode

Mac

Page 69: Engage your users with Amazon SNS Mobile Push (Now with Broadcast) - Jinesh Varia, Jon Turow

3) Register Device Apps and Endpoints in SNS

DeviPhone

Mac

Amazon SNS

AWS Cloud

Android

Page 70: Engage your users with Amazon SNS Mobile Push (Now with Broadcast) - Jinesh Varia, Jon Turow

4) Deploy Push Server Application in Elastic Beanstalk

Dev

PHP Push Server App with web UI

Elastic Beanstalk Container

MacAWS Cloud

Page 71: Engage your users with Amazon SNS Mobile Push (Now with Broadcast) - Jinesh Varia, Jon Turow

5) Server Discovers Registered SNS Device Apps and Endpoints

DevApple iPhone

PHP Push Server App with web UI

Elastic Beanstalk Container

Mac

Amazon SNS

Google

AWS Cloud

Android

Page 72: Engage your users with Amazon SNS Mobile Push (Now with Broadcast) - Jinesh Varia, Jon Turow

6) Send Notifications from Server UI via Google & Apple

DevApple iPhone

PHP Push Server App with web UI

Elastic Beanstalk Container

Notification

Mac

Amazon SNS

Google

AWS Cloud

Android

Notification