cordova - How to send server side notifications using rails & aws to phonegap device -


i'm searching solution sending server side notifications rails cordova app set of devices @ particular point in time.

let's users place bids item. each time bid placed on item, every user posted bid needs notified. notification needs take form of js callback.

now i'm digging through examples of aws sns fear doesn't fit purpose. flow on aws sns one

platform_applicaton --> platform_endpoint --> subscription topic    require 'rubygems' require 'aws-sdk'   sns = aws::sns::client.new(   access_key_id: 'x',   secret_access_key: 'x',   region: 'x',   ssl_ca_bundle: 'c:\tmp\ca-bundle.crt' )  # create platform application platform_app = sns.create_platform_application(   # required   name: "parking-space-web",   # required   platform: "gcm",   # required   attributes:     { :platformcredential => "google_api_key" ,       :platformprincipal => "" } )  puts platform_app['platform_application_arn']  #create endpoint endpoint = sns.create_platform_endpoint(   # required   platform_application_arn: platform_app['platform_application_arn'],   # required   token: "app1" )  # subscribe topic subscription = sns.subscribe(   # required   topic_arn: "arn:aws:topic:arn",   # required   #i can choose whatever protocol want physical notification    call made via specific protocol ( http/email ).   protocol: "application",    endpoint: endpoint['endpoint_arn'], ) 

how useful me? i'm publishing message via http/email plainly sent multiple http/email subscribers. if needed make http/email requests myself. what's advantage of sns?

i figure real deal sns 'application' protocol uses vendor api keys ( gcm, apns, adm, etc. ) send notification to/from specific platforms, doesn't me when using cordova. have install custom plugin intercept notifications. not bad, figure there's cleaner solution.

given found seems aws sqs best solution.

  1. can aws sqs deliver messages multiple recipients (topic-like)?
  2. do messages persist , delivered when client comes online?
  3. is feasible create 1 queue each item, , publish message each time bid placed? result in lot of queues being created.

answers questions:

  1. no, not how use sqs. sure possible have lots , lots of clients poll queue looking message, that's how sqs designed used. sqs doesn't deliver messages, clients poll messages.
  2. sqs message persist until expire (which beleive max 14 days). sns has configurable retry policies, max lifetime 60 minutes.
  3. yes possible, no don't want that.

not 100% of restraints, of technologies have mentioned, guess sns mobile push http://docs.aws.amazon.com/sns/latest/dg/snsmobilepush.html closest need.

edit: have not used cordova, article may well: https://developer.amazon.com/appsandservices/community/post/tx17carehzuwlh9/getting-started-with-the-cordova-push-notifications-plugin-for-amazon-fire-os


Comments

Popular posts from this blog

node.js - Using Node without global install -

How to access a php class file from PHPFox framework into javascript code written in simple HTML file? -

java - Null response to php query in android, even though php works properly -