Class: Maia::FCM::Service
- Inherits:
-
Object
- Object
- Maia::FCM::Service
- Defined in:
- lib/maia/fcm/service.rb
Instance Method Summary collapse
- #deliver(notification, *tokens, topic: nil) ⇒ Object
-
#initialize ⇒ Service
constructor
A new instance of Service.
- #key ⇒ Object
Constructor Details
#initialize ⇒ Service
Returns a new instance of Service.
4 5 6 |
# File 'lib/maia/fcm/service.rb', line 4 def initialize @connection ||= FCM::Connection.new key end |
Instance Method Details
#deliver(notification, *tokens, topic: nil) ⇒ Object
12 13 14 15 16 17 |
# File 'lib/maia/fcm/service.rb', line 12 def deliver(notification, *tokens, topic: nil) responses = ResponseCollection.new notification responses << deliver_all(notification, tokens) responses << deliver_all(notification, "/topics/#{topic}") if topic responses end |