Skip to content

Instantly share code, notes, and snippets.

@thebucknerlife
Last active August 29, 2015 14:03
Show Gist options
  • Save thebucknerlife/4d95dbd06733c217a5a3 to your computer and use it in GitHub Desktop.
Save thebucknerlife/4d95dbd06733c217a5a3 to your computer and use it in GitHub Desktop.
Setup AWS Simple Notification Service (SNS) in Rails 4

Setup AWS Simple Notification Service (SNS) in Rails 4

This is a simple tutorial for setting up AWS SNS with Rails 4. A few details on the implementation:

  • Instead of saving a device_token as an attribute of Users, I save all SNS data and implementation with a separate model - SNSEndpoints.
  • SNS is region specific. I'm using us-west-1 as most of our startup's users are on the west coast. You can use whatever region you like (or the default), just keep in mind your AWS has to be configured for the same region as your SNS app (which you determine during setup in the AWS web console.

Tutorial

Firstly, setup an AWS account. Also, create a fresh Rails 4 app. I'm using Ruby 2.1.2 and Rails 4.1.0.

  1. Add the necessary gems to your Gemfile.

     ```ruby
       gem 'aws-sdk'
     ```
    

    Then bundle install.

  2. Something

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment