-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from cheddar-me/use-fcm-gem
Add support for send_all to messaging client.
- Loading branch information
Showing
11 changed files
with
175 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,3 +13,6 @@ Gemfile.lock | |
|
||
# rspec failure tracking | ||
.rspec_status | ||
|
||
# ruby version | ||
.ruby-version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
module Firebase | ||
module Admin | ||
module Messaging | ||
# The response received from a batch request | ||
class BatchResponse | ||
# The list of responses (possibly empty). | ||
# @return [Array<SendResponse>] | ||
attr_reader :responses | ||
|
||
# The number of successful messages. | ||
# @return [Integer] | ||
attr_reader :success_count | ||
|
||
# The number of failed messages. | ||
# @return [Integer] | ||
attr_reader :failure_count | ||
|
||
# A response received from a batch request. | ||
# | ||
# @param [Array<SendResponse>] responses | ||
def initialize(responses:) | ||
@responses = responses | ||
@success_count = responses.count(:success?) | ||
@failure_count = responses.count - @success_count | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
module Firebase | ||
module Admin | ||
module Messaging | ||
# The response received from an individual batched request. | ||
class SendResponse | ||
# A message id string that uniquely identifies the message. | ||
# @return [String] | ||
attr_reader :message_id | ||
|
||
# The error if one occurred while sending the message. | ||
# @return [Error] | ||
attr_reader :error | ||
|
||
# A boolean indicating if the request was successful. | ||
# @return [Boolean] | ||
def success? | ||
!!@message_id | ||
end | ||
|
||
# Initializes the object. | ||
# | ||
# @param [String, nil] message_id the id of the sent message | ||
# @param [Error, nil] error the error that occurred | ||
def initialize(message_id:, error:) | ||
@message_id = message_id | ||
@error = error | ||
end | ||
end | ||
end | ||
end | ||
end |
Oops, something went wrong.