Class: RTPush::FcmAdapter
- Inherits:
-
BaseAdapter
- Object
- BaseAdapter
- RTPush::FcmAdapter
- Defined in:
- lib/rtpush/adapters/fcm_adapter.rb
Instance Attribute Summary
Attributes inherited from BaseAdapter
Class Method Summary collapse
Methods inherited from BaseAdapter
#exist?, #initialize, #valid?, validates_existence_of, validates_presence_of
Constructor Details
This class inherits a constructor from RTPush::BaseAdapter
Class Method Details
.push(message) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/rtpush/adapters/fcm_adapter.rb', line 4 def push() registration_ids = [ENV['GCM_ANDROID_DEVICE_TOKEN']] = { notification: { title: ENV['NOTIFICATION_TITLE'], body: , icon: '', click_action: '' }.reject { |_k, v| v.nil? || v.empty? }, data: { message: , picture: '' }.reject { |_k, v| v.nil? || v.empty? } }.reject { |_k, v| v.nil? || v.empty? } client.send(registration_ids, ) rescue StandardError => e raise Errors::AdapterError, e. end |