-
Notifications
You must be signed in to change notification settings - Fork 144
Implementation of InstanceIdClient to allow subscribe/unsubscribe to topic #94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
497f8c4
Compiles, ready for test
949a109
Before removal
bcdca8e
Integration tests working as expected
b668b38
Fixing some renames
b00db83
Improve docs, add missing dispose
4675f21
PR comment resolutions
a62c04f
Improve integation tests
186b96d
changes part 1
c69b430
Refactored and tests pass
b22734a
HTTP status code tests
1ccd27a
Fix broken test
3576351
Testing and refactoring
0724927
Test fixes
ea9e351
PR requetc changes
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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
46 changes: 46 additions & 0 deletions
46
FirebaseAdmin/FirebaseAdmin/Messaging/InstanceIdServiceResponse.cs
This file contains hidden or 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,46 @@ | ||
| using System.Collections.Generic; | ||
| using System.Linq; | ||
| using Newtonsoft.Json; | ||
|
|
||
| namespace FirebaseAdmin.Messaging | ||
| { | ||
| /// <summary> | ||
| /// Response from an operation that subscribes or unsubscribes registration tokens to a topic. | ||
| /// See <see cref="FirebaseMessaging.SubscribeToTopicAsync(string, List{string})"/> and <see cref="FirebaseMessaging.UnsubscribeFromTopicAsync(string, List{string})"/>. | ||
| /// </summary> | ||
| internal class InstanceIdServiceResponse | ||
| { | ||
| /// <summary> | ||
| /// Gets the errors returned by the operation. | ||
| /// </summary> | ||
| [JsonProperty("results")] | ||
| public List<InstanceIdServiceResponseElement> Results { get; private set; } | ||
|
|
||
| /// <summary> | ||
| /// Gets the number of errors returned by the operation. | ||
| /// </summary> | ||
| public int ErrorCount => Results?.Count(results => results.HasError) ?? 0; | ||
|
|
||
| /// <summary> | ||
| /// Gets the number of results returned by the operation. | ||
| /// </summary> | ||
| public int ResultCount => Results?.Count() ?? 0; | ||
|
|
||
| /// <summary> | ||
| /// An instance Id response error. | ||
| /// </summary> | ||
| public class InstanceIdServiceResponseElement | ||
Leo-Mepham marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| { | ||
| /// <summary> | ||
| /// Gets a value indicating the error in this element of the response array. If this is empty this indicates success. | ||
| /// </summary> | ||
| [JsonProperty("error")] | ||
| public string Error { get; private set; } | ||
|
|
||
| /// <summary> | ||
| /// Gets a value indicating whether this response element in the response array is an error, as an empty element indicates success. | ||
| /// </summary> | ||
| public bool HasError => !string.IsNullOrEmpty(Error); | ||
| } | ||
| } | ||
| } | ||
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.