Class: ApnsChannel
- Inherits:
-
Object
- Object
- ApnsChannel
- Defined in:
- lib/notify_user/channels/apns/apns_channel.rb
Class Method Summary collapse
- .default_options ⇒ Object
- .deliver(notification, options = {}) ⇒ Object
- .deliver_aggregated(notifications, options = {}) ⇒ Object
Class Method Details
.default_options ⇒ Object
4 5 6 7 8 |
# File 'lib/notify_user/channels/apns/apns_channel.rb', line 4 def { description: "Push Notifications" } end |
.deliver(notification, options = {}) ⇒ Object
10 11 12 13 14 15 |
# File 'lib/notify_user/channels/apns/apns_channel.rb', line 10 def deliver(notification, ={}) devices = fetch_devices(notification, [:device_method]) NotifyUser::Apns.new([notification], devices[:ios], ).push if devices[:ios].any? NotifyUser::Gcm.new([notification], devices[:android], ).push if devices[:android].any? end |
.deliver_aggregated(notifications, options = {}) ⇒ Object
17 18 19 20 21 22 |
# File 'lib/notify_user/channels/apns/apns_channel.rb', line 17 def deliver_aggregated(notifications, ={}) devices = fetch_devices(notifications.first, [:device_method]) NotifyUser::Apns.new(notifications, devices[:ios], ).push if devices[:ios].any? NotifyUser::Gcm.new(notifications, devices[:android], ).push if devices[:android].any? end |