Sha256: 3419baa6d31f1325179ab04c339ab9564a9064800cefe33c2045361d470b8cdf

Contents?: true

Size: 1.4 KB

Versions: 2

Compression:

Stored size: 1.4 KB

Contents

= Beaconpush

Beaconpush gem provides easy access to the {Beacon push service}[http://beaconpush.com/] from your application.

== Usage

  require "beaconpush"

  # You may want to put these two lines inside of an initializer in
  # your Rails application
  Beaconpush.key = "ad819983"
  Beaconpush.secret = "..."

  # Beaconpush is ready to use now!

  # Fetches the number of online users
  Beaconpush.users_count
  # => 2

  # Checks if the user is online at the moment
  Beaconpush.user_online?("alice")
  # => false

  # Sends the given message to the user
  Beaconpush.user_message("bob", "Hello Bob!")

  # Fetches the list of online users in the given channel
  Beaconpush.channel_users("myfirstchannel")
  # => ["bob"]

  # Sends the given message to the channel
  Beaconpush.channel_message("myfirstchannel", :message => "Channel message!", :severity => "important")

  # Forces the user to disconnect
  Beaconpush.user_logout("bob")

  # You can also use multiple Beacon accounts in a single application
  client1 = Beaconpush::Client.new(:key => "da10749525", :secret => "...")
  client2 = Beaconpush::Client.new(:key => "bb19021573", :secret => "...")
  client1.users_count
  # => 0
  client2.users_count
  # => 4

== Installation

  gem install beaconpush

== Copyright

Copyright (c) 2010 Jakub Kuźma. Released on the MIT license (see LICENSE[http://github.com/qoobaa/beaconpush/raw/master/LICENSE] for details).

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
beaconpush-0.0.3 README.rdoc
beaconpush-0.0.2 README.rdoc