Class: HeyYou::Channels::FcmPush
- Inherits:
-
Base
- Object
- Base
- HeyYou::Channels::FcmPush
- Defined in:
- lib/hey_you/channels/fcm_push.rb
Class Method Summary collapse
-
.send!(builder, **options) ⇒ Array{Hash}
Sending fcm message.
Class Method Details
.send!(builder, **options) ⇒ Array{Hash}
Sending fcm message
@see: firebase.google.com/docs/reference/fcm/rest/v1/projects.messages#resource:-message
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/hey_you/channels/fcm_push.rb', line 26 def send!(builder, **) [:token] ||= [:to] if [:token].is_a?(Array) = [:token].map { |token| (builder, **.merge(token: token)) } end ||= [(builder, **)] .map do || { receiver: .receiver_hash, response: HeyYouFcmPush::Connection.instance.send_notification(.to_h, validate_only: [:validate_only]) } end end |