Class: Nuntius::FirebasePushProvider
- Inherits:
-
BaseProvider
- Object
- BaseProvider
- Nuntius::FirebasePushProvider
- Defined in:
- app/providers/nuntius/firebase_push_provider.rb
Instance Attribute Summary
Attributes inherited from BaseProvider
Instance Method Summary collapse
Methods inherited from BaseProvider
all_settings, #callback, class_from_name, #initialize, #name, #refresh, setting_reader, states, transport
Constructor Details
This class inherits a constructor from Nuntius::BaseProvider
Instance Method Details
#deliver ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'app/providers/nuntius/firebase_push_provider.rb', line 11 def deliver fcm = FCM.new(server_key) = (.payload || {}).merge(data: {body: .text}) response = fcm.send([.to], ) .status = if response[:status_code] != 200 || response[:response] != "success" "undelivered" else "sent" end end |