Giter Club home page Giter Club logo

Comments (11)

2mia avatar 2mia commented on July 4, 2024

it was yanked, does somebody knows why?

from apns.

sdaswani-lookout avatar sdaswani-lookout commented on July 4, 2024

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

from apns.

 avatar commented on July 4, 2024

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

from apns.

sdaswani-lookout avatar sdaswani-lookout commented on July 4, 2024

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

from apns.

 avatar commented on July 4, 2024

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

from apns.

 avatar commented on July 4, 2024

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

from apns.

sdaswani-lookout avatar sdaswani-lookout commented on July 4, 2024

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.

from apns.

wlipa avatar wlipa commented on July 4, 2024

1.1.0 was yanked due to #22

from apns.

ZavenArra avatar ZavenArra commented on July 4, 2024

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.

from apns.

wlipa avatar wlipa commented on July 4, 2024

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

from apns.

ZavenArra avatar ZavenArra commented on July 4, 2024

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

from apns.

Related Issues (20)

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.