Code Monkey home page Code Monkey logo

em-apn's People

Contributors

arielo avatar cmdrkeene avatar daveyeu avatar dfried avatar jpignata avatar miroslavstoklasa avatar pavelsmejkal avatar sethk 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

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  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

em-apn's Issues

Publish as a gem?

Hey i like the looks of this. Any chance we'll see it on Rubygems.org soon?

Automattic reconnect seems to be broken

When I send an invalid token i get:

I, [2011-11-11T11:56:32.038103 #41783] INFO -- : TOKEN=df6f35d25288c0be4ed6e91cc404439c1b79b02999d662c7d65b139289bcbdc0
I, [2011-11-11T11:56:32.173585 #41783] INFO -- : CODE=8 ID=256 DESC=Invalid token
Got data: [8, 8, 256]

The last line is my on_receipt output.

If i then send a valid token i see

I, [2011-11-11T11:56:54.579125 #41783] INFO -- : TOKEN=520b12a526c0788425e5c9f6a7fd069eaf99d5ddda296fad2317b0e2dc9e44aa

and nothing further.

If i then send a broken token again, i do not get a reciept.

This makes me think that em-apn is not reestablishing the connection, and not letting us know it's down.

Payload size

Currently there is no payload trimming in Notification class.

As documentation states: "The payload must not exceed 256 bytes and must not be null-terminated.". From my experience problems will start appearing on production gateway.

Any way to hold persistent connection while perform resque jobs

I come from apn-sender. Apn-sender is not support apn so I want give a try on em-apn

When I walk through em-apn code , find I can use ./script/pusher , to send notifications to apple.

Apn-sender have a worker for resque-jobs. Does em-apn have plan on this kind of feature?

Run on Unicorn

When I run on Unicorn server, I got this:

RuntimeError (eventmachine not initialized: evma_connect_to_server):
 app/models/message_service.rb:4:in `deliver'

And It works well on Thin.

Here's my code

class MessageService
  def self.deliver(message)

    client = EM::APN::Client.connect(
      :key     => message.project_apn_key.current_path,
      :cert    => message.project_apn_cert.current_path
    )

    client.on_error do |response|
      # See EM::APN::ErrorResponse
      ap response
    end

    client.on_close do
      # Do something.
    end

    message.groups.each do |group|
      group.devices.each do |device|
        notification = EM::APN::Notification.new(
          device.token,
          :alert => message.alert,
          :badge => message.badge,
          :sound => message.sound
        )
        client.deliver(notification)
      end
    end
  end
end

I don't understand.

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.