welcome back to Backspace Academy in this lecture I'm going to run through 2
the simple notification service or SNS for short I'll run through what exactly 3
is SNS and what are the transport protocols we can use for sending 4
messages with SNS I'll look at what a message format looks like I'll look at 5
the mobile push notification service which allows us to send messages via a 6
push notification to mobile devices I'll look at the setup for Amazon devices 7
such as Kindle Fire I'll look at the setup for Apple devices and for Google 8
devices for mobile push notifications 9
Amazon SNS it's a messaging service that enables the sending of messages up to 10
256 K to subscribing endpoints or clients the topic name for an SNS topic 11
is unique and it describes the endpoint for 12
publishers to post messages to subscribers subscribe to a topic name 13
and then the subscriber access to topics is determined through an SNS policy so 14
on that diagram there we can see that a publisher can publish to an SNS topic 15
whatever that message may be and they can do that through the console through 16
one of the software development kits or through the command line interface and 17
that SNS topic will then distribute it to a HTTP endpoint or an email or it 18
will go to an sqs queue or AWS lambda function you can go to an SMS to a phone 19
number and you can also go to as a mobile push notification to a mobile 20
device the transport protocols available for Amazon SNS messages are HTTP or 21
HTTPS so subscribers can specify a URL as part of their subscription 22
registration and then those notifications from SNS at them so they 23
have subscribed to will be delivered via a HTTP HTTP POST call 24
the specified URL the next one is email or e-mail JSON messages are sent to a 25
registered address as an email email JSON are sent as a JSON object while 26
email is sent as a text-based email SQS users can specify and SQS 27
standard queue as the input unfortunately FIFO queues are currently 28
not supported for that and we have SMS messages are sent to registered phone 29
numbers as SMS text messages and that service is not available in every 30
country of course because not all of those phone numbers will be available 31
across the whole entire globe the message format for the transport of 32
messages with email the transport only contains the payload or the message body 33
but for the others which includes HTTP HTTP email JSON and SQS transport 34
protocols it includes the message ID which is a universally unique identifier 35
that is unique for each notification that gets published it'll have a 36
timestamp it will have the topic aar n which is a topic to which the message 37
was published to the SNS topic you'll have a type and we'll have an 38
unsubscribe URL which is a link to an unsubscribe endpoint to prevent 39
receiving any further notifications it will of course have the message or the 40
payload of the body and it'll have a subject field if one was included is an 41
optional parameter and it will have a signature which is a base64 encoded 42
sha-1 with RSA signature and that is of the message the message ID the subject 43
if it's present the type timestamp and topic values and signature version which 44
will be the version of the Amazon SNS signature that was used SNS Mobile push 45
notifications allow the SNS service to deliver messages directly to mobile 46
devices as a mobile push notification so the high level steps around it and you 47
will really need to know just high level steps around this you 48
for an associate level certification you're going to need to be very much an 49
expert in this area so the first step is to request credentials from the mobile 50
platform and then request a token from the mobile platforms so with a DA DM or 51
the Amazon or Google you get a registration ID and from Apple you will 52
get a device token from there you can create an SNS platform application 53
object and then you create an SNS platform endpoint object and then you 54
publish SNS messages to the mobile endpoint the Amazon device messaging 55
steps first you need to create a Kindle Fire app with the ADM service enabled 56
from there you can obtain a client ID and a client secret and then you can 57
obtain an API key and from there you can obtain a registration ID so once you 58
have that registration ID you can then use the user with the mobile push 59
notification service to enable push notifications to ATM and that will send 60
messages through to the ATM server and those messages will then be forward on 61
to subscribing a dead ATM clients the Apple push notification service steps 62
are a little bit more complicated first you need to create an iOS app you then 63
need to obtain an a kns SSL certificate you then need to obtain the app private 64
key and then you need to verify the certificate and the app private key and 65
from there you can obtain a device token and from there you use that again with 66
the SNS mobile push notification which will then allow SNS to send messages 67
through to the APNs service and then on to subscribing mobile devices for 68
cloud messaging for Android you first create a Google API project and then 69
enable the GCM service and then you obtain a server API key and then obtain 70
a registration ID from GCM which you then again use with SNS Mobile push 71
notification to for messages through to Google Cloud messaging and then on to 72
subscribing mobile devices so that is it for SNS or simple notification service I 73
look forward to seeing you in future lessons