Register mobile / Android endpoint with Amazon SNS mobile push service -


i want use amazon sns mobile push notifications in combination gcm push notifications android devices.

i have gcm on app , running, receives registration id google , can receive notification if

the next step device registering endpoint sns service. this, documentation suggests:

to register tokens devices install apps in future

you can use 1 of following 2 options:

use amazon cognito service: mobile app need credentials create endpoints associated amazon sns platform application. recommend use temporary credentials expire after period of time. scenarios, recommend use amazon cognito create temporary security credentials. more information, see creating temporary security credentials mobile apps using identity providers. if notified when app registers amazon sns, can register receive amazon sns event provide new endpoint arn. can use listendpointbyplatformapplication api obtain full list of endpoints registered amazon sns.

use proxy server: if application infrastructure set mobile apps call in , register on each installation, can continue use setup. server act proxy , pass device token amazon sns mobile push notifications, along user data store. purpose, proxy server connect amazon sns using aws credentials , use createplatformendpoint api call upload token information. newly created endpoint amazon resource name (arn) returned, server can store making subsequent publish calls amazon sns.

given don't want use proxy server, let device register directly sns create mobile endpoint (about web identity federation), following hypothesis correct?

i either have store credentials access aws account directly in app (not option of course) or user have identify via openid account (which don't want because user's won't identify receive push messages).

ascorbin - yes, you'll want use cognito federated identity. cognito identity allows create temporary limited aws credentials, enabling app users create sns platform endpoint or subscribe sns topic without ever logging in. first create cognito identity pool , cognito assign 2 roles (auth & unauth) application end users.

within unauthenticated iam role, give permissions sns:createplatformendpoint or sns:subscribe depending on use case. once create identity pool in aws console, you'll see "sample code" android implement amazon cognito credentials provider in android app. note: when creating identity pool, don't forget select "enable access unauthenticated identities" unauthenticated iam role created , app users can have limited access aws resources without logging in.

if want see working sample android app, checkout aws mobile hub , create project , download/run android sample app accesses aws resources using cognito identity.


Comments

Popular posts from this blog

ruby on rails - Permission denied @ sys_fail2 - (D:/RoR/projects/grp/public/uploads/ -

c++ - nodejs socket.io closes connection before upgrading to websocket -

python - PyQt: Label not showing correct number of length -