I need a way to invoke some code when feedback is received so I can mark users/devices as do not send any more notifications.
Since the feedback is being handled by rapns with a rails environment loaded (connection to database, etc), this could easily be done from within rapns itself if we could specify the block to execute when feedback is received.
My idea is that the user with the Rails app can create a config/initializers/rapns.rb file and do something like this:
Rapns.configure do |config|
config.on_feedback do |feedback|
device = Device.find_by_device_token feedback.device_token
device.active = false
And that block will be called when feedback is received.
Adding Rapns::Config class; Adding support for Config to be modified …
…from the rails app 'config/initializers/rapns.rb' file; Adding Feedback receiver call a callback when feedback is received.
For issue #77