AWS Black Belt Tech‚·ƒƒ¼‚ Amazon SNS...

download AWS Black Belt Tech‚·ƒƒ¼‚ Amazon SNS ƒ¢ƒ‚¤ƒ«ƒ—ƒƒ‚·ƒ¥

of 68

  • date post

    16-Jul-2015
  • Category

    Technology

  • view

    3.152
  • download

    5

Embed Size (px)

Transcript of AWS Black Belt Tech‚·ƒƒ¼‚ Amazon SNS...

  • Amazon SNS Mobile Push AWS Black Belt Tech Webinar 2015 () 2015.03.11

  • WEST Web AWS ( slideshare)

  • Agenda

    AWS Amazon SNS Mobile Push

    SDK, IDE

    Amazon SNS Mobile Push

    Q&A

  • Agenda

    AWS Amazon SNS Mobile Push

    SDK, IDE

    Amazon SNS Mobile Push

    Q&A

  • ID

    Your Mobile App

  • AWS

    Amazon Cognito

    Kinesis Connector DynamoDB Connector S3 Connector SQS Connector SES Connector

    ()

    AWS Mobile SDK, API Endpoints, Management Console

    SDK

    Amazon Mobile Analytics Amazon SNS Mobile Push

  • Your Mobile App

    Amazon Cognito(Identity Broker)

    AWS Identity and Access Management

    Amazon Cognito (Sync)

    Amazon Mobile Analytics

    Amazon Mobile Analytics

    Amazon S3Transfer Manager

    Amazon CloudFront(Device Detection)

    Amazon DynamoDB(Object Mapper)

    Amazon Kinesis(Recorder)

    Amazon SNS Mobile Push

    AWS Mobile SDK

  • 1

    Amazon Mobile Analytics

    Amazon Cognito

    Amazon SNS Mobile Push

  • Agenda

    AWS Amazon SNS Mobile Push

    SDK, IDE

    Amazon SNS Mobile Push

    Q&A

  • 1

  • (e.g. Apple, Google, Amazon)

  • (e.g. Apple, Google, Amazon)

  • 1.

    2. (Token)

    3. (Token)

    6. (Token + Payload)

    7. (Payload)

    4. (Token) 5. (Payload)

  • Apple APNS

    Google GCM

    Amazon ADM

    API

  • Apple APNS

    Google GCM

    Amazon ADM

  • API

    ASP

    MBaaS

    OSS

    Apple APNS

    Google GCM

    Amazon ADM

  • Amazon SNS Mobile Push

  • Amazon SNS Mobile Push

    Amazon SNS Mobile Push

    Apple Devices

    Google Devices

    Amazon Kindle Fire Devices

    >

  • Apple Push Notication ServiceAPNS Google Cloud MessagingGCM Amazon Device MessagingADM Baidu Cloud PushBaidu Microsoft Push Notication Service for Windows PhoneMPNS:Windows 8 , Windows Phone 8.1

    Windows Push Notication ServicesWNS:Windows Phone 7

  • Endpoint Topic

    Endpoint Topic

    Topic

    SNS SNS

    Endpoint

    SNS

    Endpoint

    Endpoint

    Endpoint

    Endpoint

    11,000()3,000

    Endpoint

    1ebf21e3e1c56d061be2c520f448..

    arn:aws:sns:ap-northeast-1:xxxxxxx:endpoint/APNS_SANDBOX/MobilePushTest/xxxx-xxxx-xxxx-xxxx1

    1d3a8db9eba038315385cdb892ab..

    arn:aws:sns:ap-northeast-1:xxxxxxx:endpoint/APNS_SANDBOX/MobilePushTest/xxxx-xxxx-xxxx-xxxx2

    2abc3273330ea22b8f95503b93ee3..

    arn:aws:sns:ap-northeast-1:xxxxxxx:endpoint/APNS_SANDBOX/MobilePushTest/xxxx-xxxx-xxxx-xxxx3

  • Apple

    Kindle Fire

    Windows Phone

    Google

    Publish

    Apple

    Kindle Fire

    Windows Phone

    Google

    Publish

    Publish

  • Publish

    Publish

    Publish

    Publish

    Topic

    Topic

    11,000()3,000

    Endpoint

    Endpoint

    Endpoint

    Endpoint

    Endpoint

    Endpoint

  • Apple Push Notification Service (APNS)

    256 bytes(~iOS7), 2KB(iOS8) https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/

    RemoteNotificationsPG/Chapters/ApplePushService.html Google Cloud Messaging (GCM)

    4096 bytes http://developer.android.com/intl/ja/google/gcm/adv.html

    Amazon Device Messaging (ADM) 6144 bytes https://developer.amazon.com/sdk/adm/sending-message.html

    Baidu Cloud Push (Baidu) 256 bytes http://docs.aws.amazon.com/ja_jp/sns/latest/dg/SNSMobilePushBaiduPublish.html

    Microsoft Push Notification Service for Windows Phone (MPNS) 3072 bytes https://msdn.microsoft.com/ja-jp/library/ff402558%28v=vs.92%29.aspx

    Windows Push Notification Services (WNS) 5000 bytes https://msdn.microsoft.com/ja-jp/library/windows/apps/hh465435.aspx#WNSResponseCodes

  • Amazon SNS Mobile Push

  • SDKIDE

    SDK

    IDE

    Eclipse Visual Studio CLI Powershell

    iOS Android Java Python PHP .NET Ruby Node.js JavaScript

  • Amazon SNS Mobile Push

    ...

    ...

  • 100 100 Publish SNS 100 SNS

    100 $1.00 $0.50 100 publish SNS $0.50 100 SNS

  • Agenda

    AWS Amazon SNS Mobile Push

    SDK, IDE

    Amazon SNS Mobile Push

    Q&A

  • https://s3.amazonaws.com/codesamples/sns/latest/snsmobilepush.zip

    iOS ~iOS7.1

    Java

  • iOS

    didFinishLaunchingWithOptions Device Token APNS

    didRegisterForRemotoNotication Device Token

    didRecieveForRemotoNotication

  • iOS 1. []

    deviceToken: e1ebf21e 3e1c56d0 61be2c52 0f448fb1 42c32456 45d2dd97 d1ce5fb5 7436394a

    2.

    3.

  • 1. [Add a New App]

  • 1. [Application Name] 2. [Push Platform] [APNS_SANDBOX]

    3. [Browse] [] 4. [Enter Password] 5. [Load Credentials from File]

    6. [Add New App]

  • 34. [Add Endpoint]

    3. [User Data]

    2. []

    User Data SNS 2KB, UTF8

    CSV 2MB

    1. [Add Endpoint]

  • Endpoint

    3. [Message]

    1. [Endpoint] 1 2. [Publish]

    4. [TTL]

    5. [Use text fomat] TTL()

    6. [Publish Message]

  • OK

  • Topic Endpoint Subscribe 1. [Create New Topic]

    2. [Topic Name]

    3. [Create Topic]

    4. [Create Subscription]

    5. [Application] 6. [Endpoint]

    7. [Subscribe]

  • Topic

    1. [Publish]

    2.

    3. [Publish Message]

  • OK

    OK

    OK

  • Amazon SNS Mobile Push

    SNS (2-tier) Credential SNS Token Vending Machine Temporary credential

    SNS Amazon Cognito Temporary credential

    SNS

    SNS (3-tier) API SNS

  • Credential SNS

    1.

    2.

    3. (Create Platform

    Endpoint)

    SNS

    Credential

    4. EndpointArn

    5. EndpointArn

    EndpointArn,

  • Credential

    Credential SNS

  • Token Vending Machine Temporary credential SNS

    1.

    2.

    5. (Create Platform Endpoint)

    SNS6. EndpointArn

    AWS Security Token Service

    3. Temporary credential

    4. Temporary credential

    EndpointArn,

    TVM

    7. EndpointArn

    TVM

    Web

    ELB

  • Credential

    Token Vending Machine Temporary credential SNS

    TVM

  • Amazon Cognito Temporarycredential SNS

    1.

    2.

    5. (Create Platform Endpoint)

    SNS6. EndpointArn

    3. Temporary credential

    4. Temporary credential

    EndpointArn,

    TVM

    7. EndpointArn

    Cognito

  • Credential

    Amazon Cognito Temporarycredential SNS

  • API SNS

    1.

    2.

    3.

    4. (Create Platform

    Endpoint)

    5. EndpointArn

    6. EndpointArn

    SNS

    Credential

    Credential

    DatabaseWeb

    ELB

  • API SNS

    1.

    2.

    3.

    4. (Create Platform

    Endpoint)

    5. EndpointArn

    6. EndpointArn

    SNS

    Credential

    Credential

    DatabaseWeb

    ELB

    SQSWorker RDS

    DynamoDBCloudSearch

  • API SNS

  • Amazon SNS Mobile Push

    1(Endpoint) or (Topic)

  • SNS

    Topic

    1. Publish

    2.

    3.

    ManagementConsole

  • 5.

    2. EndpointArn

    SNS

    Credential

    Credential

    1.

    Web Database

    ELB

    Worker

    3. Publish4.

  • SNS

    TVMCognito

    SNS

    SNS

    Credential

    Credential

    Web Database

    ELB

    Worker

    Topic

  • Endpoint Java

    String applicationArn = platformApplicationResult.getPlatformApplicationArn(); CreatePlatformEndpointRequest platformEndpointRequest =

    new CreatePlatformEndpointRequest(); platformEndpointRequest.setCustomUserData(customData); platformEndpointRequest.setToken(platformToken); platformEndpointRequest.setPlatformApplicationArn(applicationArn); CreatePlatformEndpointResult platformEndpointResult =

    snsClient.createPlatformEndpoint(platformEndpointRequest);

    ARN

  • Endpoint Java

    PublishRequest publishRequest = new PublishRequest(); Map messageMap = new HashMap(); messageMap.put(platform.name(), getPlatformSampleMessage(platform)); publishRequest.setTargetArn(platformEndpointResult.getEndpointArn()); publishRequest.setMessageStructure("json"); message = jsonify(messageMap); publishRequest.setMessage(message); PublishResult publishResult = snsClient.publish(publishRequest);

    Publish

  • Event 2. Endpoint / / /

    EventSNS

    1. [Congure Events]

    3. [Save Conguration]

    { "EndpointArn":"arn:aws:sns:ap-northeast-1:xxxxxxxxxx:endpoint/APNS_SANDBOX/MobilePushTest/xxxx-xxxx-xxxx-xxxx", "EventType":"EndpointCreated", "Resource":"arn:aws:sns:ap-northeast-1:xxxxxxxxxx:app/APNS_SANDBOX/MobilePushTest", "Service":"SNS", "Time":"2015-03-11T03:45:22.545Z", "Type":"EndpointCreated }

    4. Event

  • CloudWatch

    1. [Delivery Status]

    2. [Save Conguration]

    3. CloudWatch

  • SNS

    Credential

    Credential

    Web Database

    ELB

    Worker1.

    2. Event, Log

    Worker3.

  • Amazon SNS Mobile Push

    (Apple, Google, Amazon, Baidu, Windows) 100 100 $1.00

  • Agenda

    AWS Amazon SNS Mobile Push

    SDK, IDE

    Amazon SNS Mobile