Class: Noticed::DeliveryMethods::ActionPushNative

Inherits:
Noticed::DeliveryMethod show all
Defined in:
lib/noticed/delivery_methods/action_push_native.rb

Instance Attribute Summary

Attributes inherited from Noticed::DeliveryMethod

#config, #event, #notification

Instance Method Summary collapse

Methods inherited from Noticed::DeliveryMethod

#evaluate_option, #fetch_constant, #perform

Methods included from ApiClient

#post_request

Instance Method Details

#deliverObject



6
7
8
9
10
11
12
13
14
15
# File 'lib/noticed/delivery_methods/action_push_native.rb', line 6

def deliver
  notification = evaluate_option(:silent) ? notification_class : notification_class.silent

  notification
    .with_apple(evaluate_option(:with_apple))
    .with_google(evaluate_option(:with_google))
    .with_data(evaluate_option(:with_data))
    .new(**evaluate_option(:format))
    .deliver_later_to(evaluate_option(:devices))
end

#notification_classObject



17
18
19
# File 'lib/noticed/delivery_methods/action_push_native.rb', line 17

def notification_class
  fetch_constant(:class) || ApplicationPushNotification
end