Closed printercu closed 7 years ago
Hi!
WDYT about supporting input hashes in #push and similar methods? I've found that there is new field thread-id in notification body.
#push
thread-id
If gem would support something like this, it'll be possible to use it without modification after every new field added:
connection.push( headers: { 'apns-id' => apns_id, ... }, body: { alert: { ... }, 'thread-id' => 1, } )
And Notification can still be supported. It may have #to_h, returning {headers: , body:}, and there will be single check notification = notification.to_h if notification.is_a?(Notification).
Notification
#to_h
{headers: , body:}
notification = notification.to_h if notification.is_a?(Notification)
If you like the idea, I can prepare PR for it.
UPD. forgot about :token field.
:token
Thank you for the input. I don't like this approach, I'd rather ensure that the needed field are properly added to notification.rb.
notification.rb
Hi!
WDYT about supporting input hashes in
#push
and similar methods? I've found that there is new fieldthread-id
in notification body.If gem would support something like this, it'll be possible to use it without modification after every new field added:
And
Notification
can still be supported. It may have#to_h
, returning{headers: , body:}
, and there will be single checknotification = notification.to_h if notification.is_a?(Notification)
.If you like the idea, I can prepare PR for it.
UPD. forgot about
:token
field.