Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sending to multiple apps #3

Open
eddanger opened this issue Feb 12, 2013 · 6 comments
Open

Sending to multiple apps #3

eddanger opened this issue Feb 12, 2013 · 6 comments
Assignees

Comments

@eddanger
Copy link

I need the ability to send to different apps/devices from a single Rails application.

The certificate will be different for each push and the current Module doesn't make much sense for the way I do it.

Anyway any future plans for something like this?

class PusherIOS
  include APNS

  def initialize(gateway, port, certificate, passphrase)
    @host = gateway
    @port = port
    @pem  = certificate
    @pass = passphrase
  end
end

certificate = "#{Rails.root}/lib/development.pem"
passphrase = "dapassphrase"
gateway = "gateway.sandbox.push.apple.com"
port = 2195

pusher = PusherIOS.new(gateway, port, certificate, passphrase)

pusher.send_notification(d1.device_token, :alert => 'Hello iPhone!', :badge => 1, :sound => 'default',  :other => {:sent => 'with apns gem', :custom_param => "value"})

This is so we could use an object that is specific to a certificate/passphrase rather than a global module.

@lloydmeta
Copy link
Contributor

Maybe .dup or .clone the module (APNS and GCM)? The notification objects themselves have no say in the connection anyway.

@ghost ghost assigned NicosKaralis Feb 18, 2013
@NicosKaralis
Copy link
Owner

this is something i definitely want to implement.

I'm a little busy at the moment but as soon as i got time i will look into it.

@pepicrft
Copy link

pepicrft commented Aug 5, 2014

@eddanger I did it modifying this library in this fork
https://github.com/teambox/pushmeup
It might be useful for you, If you have any doubt let me know

@23tux
Copy link

23tux commented Dec 7, 2014

+1 I would also need this. Any chance that this PR gets merged?

@fawad
Copy link

fawad commented Mar 16, 2015

+1 Would like you guys to merge this.

@warantesbr
Copy link

Hi @NicosKaralis! There's any reason this PR was not merged?

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

No branches or pull requests

7 participants