Skip to content
This repository has been archived by the owner on Jan 29, 2024. It is now read-only.

Push 1.1.0 to RubyGems.org? #25

Open
sdaswani-lookout opened this issue Dec 16, 2013 · 11 comments
Open

Push 1.1.0 to RubyGems.org? #25

sdaswani-lookout opened this issue Dec 16, 2013 · 11 comments

Comments

@sdaswani-lookout
Copy link
Collaborator

Any idea when you'll push 1.1.0 to rubygems.org? From what I can tell 1.0.0 is the most recent version?

http://rubygems.org/gems/apns

Thanks!
Susheel

@2mia
Copy link

2mia commented Dec 20, 2013

it was yanked, does somebody knows why?

@sdaswani-lookout
Copy link
Collaborator Author

Any update on this? The new push notifications introduced in iOS7 won't work without v1.1.0.

@ghost
Copy link

ghost commented Jan 25, 2014

@sdaswani-lookout what do you mean it won't work without it?

@sdaswani-lookout
Copy link
Collaborator Author

@jeremy-- From what I can tell, you can't send silent push notifications (i.e., no fields except 'content-available=1') with v1.0.0 of APNS. Have they worked for you?

@ghost
Copy link

ghost commented Feb 7, 2014

You're right, the content-available field does not get added to the json hash for some reason

@ghost
Copy link

ghost commented Feb 7, 2014

Yeah, so this is what notifications in the gem provided by rubygems (v1.0.0) looks like

module APNS
  class Notification
    attr_accessor :device_token, :alert, :badge, :sound, :other

    def initialize(device_token, message)
      self.device_token = device_token
      if message.is_a?(Hash)
        self.alert = message[:alert]
        self.badge = message[:badge]
        self.sound = message[:sound]
        self.other = message[:other]
      elsif message.is_a?(String)
        self.alert = message
      else
        raise "Notification needs to have either a hash or string"
      end
    end

    ...

  end
end

Doesn't even include a field for 'content-available' so it is completely omitted, just override the initializer and packager like so

module APNS
  class Notification
    attr_accessor :content_available

    def initialize(device_token, message)
      ...
      self.content_available = !message[:content_available].nil?
      ...
    end

    ...
    def packaged_message
      ...
      aps['aps']['content-available'] = 1 if self.content_available
      ...
    end
  end
end

it also looks like they might pad message identifiers at the end and priorities... but I don't know if that has any effect on what happens with the notification. Hell you could just override the whole class with the code here somewhere in your program until they re-push v1.1.0 to rubygems

@sdaswani-lookout
Copy link
Collaborator Author

Thanks for the info @jeremy-- ! I actually practiced some self-help and just pushed 1.1.0 to rubygems under a different name: http://rubygems.org/gems/apns-lookout Since my use is pretty limited (I'm only using it for silent pushes) and that use seems to work just fine I'm not worried about the issues that @jpoz says kept him from pushing 1.1.0.

@jpoz wants me to start helping out maintain this so I will do that and then hopefully we can push 1.1.0 back to rubygems then.

@wlipa
Copy link

wlipa commented Mar 14, 2014

1.1.0 was yanked due to #22

@ZavenArra
Copy link

what's the current status on this? is 1.1.0 ok to use? #22 doesn't seem to have been closed an inactive since Sept.

@wlipa
Copy link

wlipa commented May 29, 2014

Not sure - I switched to https://github.com/nomad/houston since it seemed like this gem wasn't being actively maintained.

@ZavenArra
Copy link

thanks.. i'm on my way to switching to rpush.

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

No branches or pull requests

4 participants