APNS icon indicating copy to clipboard operation
APNS copied to clipboard

Push 1.1.0 to RubyGems.org?

Open sdaswani-lookout opened this issue 12 years ago • 11 comments

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

sdaswani-lookout avatar Dec 16 '13 22:12 sdaswani-lookout

it was yanked, does somebody knows why?

2mia avatar Dec 20 '13 12:12 2mia

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

sdaswani-lookout avatar Dec 27 '13 18:12 sdaswani-lookout

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

ghost avatar Jan 25 '14 23:01 ghost

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

sdaswani-lookout avatar Jan 27 '14 16:01 sdaswani-lookout

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

ghost avatar Feb 07 '14 03:02 ghost

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

ghost avatar Feb 07 '14 09:02 ghost

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.

sdaswani-lookout avatar Feb 07 '14 17:02 sdaswani-lookout

1.1.0 was yanked due to https://github.com/jpoz/APNS/pull/22

wlipa avatar Mar 14 '14 16:03 wlipa

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.

ZavenArra avatar May 29 '14 22:05 ZavenArra

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

wlipa avatar May 29 '14 22:05 wlipa

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

ZavenArra avatar May 29 '14 23:05 ZavenArra