Coder Social home page Coder Social logo

rack-push-notification's Introduction

Rack::PushNotification

A Rack-mountable web service for managing push notifications

This project is no longer maintained.

Rack::PushNotification is Rack middleware that generates API endpoints that can be consumed by iOS apps to register and unregister for push notifications.

Example Record

Field Value
token "ce8be627 2e43e855 16033e24 b4c28922 0eeda487 9c477160 b2545e95 b68b5969"
alias [email protected]
badge 0
locale en_US
language en
timezone America/Los_Angeles
ip_address 0.0.0.0
lat 37.7716
lng -122.4137
tags ["iPhone OS 6.0", "v1.0", "iPhone"]
  • Each device has a token, which uniquely identifies the app installation on a particular device.
  • This token can be associated with an alias, which can be a domain-specific piece of identifying information, such as a username or e-mail address.
  • A running badge count keeps track of the badge count to show on the app icon.
  • A device's locale & language can be used to localize outgoing communications to that particular user.
  • Having timezone information gives you the ability to schedule messages for an exact time of day and to ensure maximum impact (and minimum annoyance).
  • An ip_address --- along with lat and lng --- lets you to specifically target users according to their geographic location.

Important Use Rack::PushNotification in conjunction with some kind of authentication, so that the administration endpoints aren't publicly accessible.

Usage

Rack::PushNotification can be run as Rack middleware or as a single web application. All that's required is a connection to a Postgres database. Define this with the environment variable DATABASE_URL.

For rails, use the rails-database-url gem to define this from the database.yml.

An example application can be found in the /example directory of this repository.

config.ru

require 'bundler'
Bundler.require

run Rack::PushNotification

Deployment

Rack::PushNotification can be deployed to Heroku with the following commands:

$ heroku create
$ git push heroku master

Contact

Mattt

License

Rack::PushNotification is available under the MIT license. See the LICENSE file for more info.

rack-push-notification's People

Contributors

dennisreimann avatar joefiorini avatar mattt avatar mxswd avatar rbeiter avatar tombenner avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rack-push-notification's Issues

sprockets/sass error

I'm getting an error with the sass generating:

15:56:57 web.1 | SystemStackError - stack level too deep
15:56:57 web.1 | (in /Users/xxx/work/RackPushNotification/lib/rack/push-notification/assets/stylesheets/screen.sass):
15:56:57 web.1 | /Users/xxx/.rvm/gems/ruby-1.9.3-p374/gems/sprockets-2.8.2/lib/sprockets/context.rb:200

I'm getting this just trying to stand up the example app.

How can I compose a push notification?

Hello Mattt ,

README file said that

Rack::PushNotification spawns an admin console that gives you a convenient interface to manage device tokens and compose targeted push notification messages.

But after digging into the source, I found only PUT and DELETE endpoints are provided and also the source of the admin console has been refactored out of the project. Therefore, is Rack::PushNotification only aimed to manage device tokens or is there any plan or suggestion on delivering the push notification ?

Thanks you ๐Ÿ˜ƒ

Clean `bundle install` does not work

Problem

Currently there is no way to do a bundle install from a cloned version of this gem, because the requiring of the dependencies in the gemspec do not work. The first error one encounters is

There was a LoadError while evaluating rack-push-notification.gemspec: 
cannot load such file -- rack from
  /Users/dbloete/Sources/rack-push-notification/rack-push-notification.gemspec:3:in `<main>'

The "rack/push-notification"` that is required at the top of the gemspec requires some more dependencies (rack, rack-contrib, sinatra, sequel), which are not present in case of a clean bundle install, because they are stated in the specification below.

The same problem exists for the example app.

Solutions

There are at least two ways to fix this:

  • Move the version declaration from a separate file directly to the gemspec: There is not really a need for having it in a version file, because the gemspec is the only file that needs the version information - but it's somewhat of a bundler convention for having a separate file for that (even though bundler does not enforce it)
  • Move the dependency declarations from the gemspec to the Gemfile and do not load the gemspec in the Gemfile.

@mattt what do you think about this?

Issues as middleware in rails app

I wanted to try this gem out in a new project rather than rolling my own again. However, I ran into a couple of issues that prevented its use:

  1. My first attempt was with the 0.0.1 gem. I added it to my application.rb using config.middleware.use(::Rack::PushNotification). This worked, except it stomped over my normal rails routes. I couldn't hit any of the app's actions (dispatch failed, 404) until I removed it.
  2. I saw that it was upgraded to 0.1.0 so I gave it another shot. This time, bundler will not install the 0.1.0 gem into a rails project, because there is a conflict on the sprockets gem version.

Might not be something you can or want to fix, just thought I'd give a heads up.

Bundler could not find compatible versions for gem "sprockets":
In Gemfile:
    rack-push-notification (>= 0.1.0) ruby depends on
      sprockets (~> 2.8.1) ruby

  rails (= 3.2.9) ruby depends on
    sprockets (2.2.1)

sqlite not supported - Why postegres only?

I'm new to this framework and I'm experimenting with it with helios.
Not that I can't support postres but sqlite support would make things easier.
Why is this a postres only framework? Is pg_array really required for anything.

Heroku deploy fails

-----> Heroku receiving push
-----> Ruby app detected
sh: Syntax error: EOF in backquote substitution
 !
 !     Invalid RUBY_VERSION specified: There-was-a-LoadError-while-evaluating-rack-push-notification.gemspec:-no-such-file-to-load----rack-from-/tmp/build_270mkjf0y2vz0/rack-push-notification.gemspec:3:in-`<main>'-Does-it-try-to-require-a-relative-path?-That's-been-removed-in-Ruby-1.9.
 !     Valid versions: ruby-1.9.3-p0, ruby-1.9.3-p125, rbx-1.2.4, rbx-2.0.0dev-20120115-1.9, rbx-2.0.0dev-20120115-1.8, rbx-2.0.0dev-20120123-1.9, rbx-2.0.0dev-20120123-1.8, ruby-1.9.2-p290, jruby-1.6.5.1, jruby-1.6.7, ruby-2.0.0, ruby-1.9.3, ruby-1.9.2, ruby-1.8.7, ruby-1.9.3-jruby-1.7.0.preview1, ruby-1.8.7-jruby-1.7.0.preview1, ruby-1.9.3-jruby-1.7.0.preview2, ruby-1.8.7-jruby-1.7.0.preview2, ruby-1.9.3-jruby-1.7.0.RC1, ruby-1.8.7-jruby-1.7.0.RC1, ruby-1.9.3-jruby-1.7.0.RC2, ruby-1.8.7-jruby-1.7.0.RC2, ruby-1.9.3-rbx-2.0.0dev, ruby-1.8.7-rbx-2.0.0dev
 !
sh: Syntax error: EOF in backquote substitution
 !     Heroku push rejected, failed to compile Ruby app

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.