FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

feat: add fcm_options property to webpush config by Odonno · Pull Request #64 · firebase/firebase-admin-dotnet · GitHub

feat: add fcm_options property to webpush config - #64

Merged
hiranya911 merged 9 commits into
firebase:masterfrom
Odonno:feat/fcm_options
Jun 3, 2019
Merged

feat: add fcm_options property to webpush config#64
hiranya911 merged 9 commits into
firebase:masterfrom
Odonno:feat/fcm_options

Conversation

Odonno commented Jun 3, 2019

Copy link
Copy Markdown
Contributor

No description provided.

Copy link
Copy Markdown

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here (e.g. I signed it!) and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

Odonno commented Jun 3, 2019

Copy link
Copy Markdown
Contributor Author

I signed it!

Copy link
Copy Markdown

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

hiranya911 left a comment
edited
Loading

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Looks good. Please update the tests, and add an entry to the CHANGELOG file.

@@ -0,0 +1,32 @@
// Copyright 2018, Google Inc. All rights reserved.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

2019

[JsonProperty("link")]
public string Link { get; set; }
}
} No newline at end of file

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Add newline at eof

hiranya911 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Thanks @Odonno. Just a couple of updates needed to the validation logic, and rename the property to FcmOptions.

/// </summary>
internal WebpushFcmOptions CopyAndValidate()
{
if (this.Link != null && !this.Link.StartsWith("https"))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Create the copy first and then run validation on that.

var copy = ...;

if (copy.Link != null && !copy.Link.StartsWuth("https://")
{

}

/// </summary>
internal WebpushFcmOptions CopyAndValidate()
{
if (this.Link != null && !this.Link.StartsWith("https"))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Can we also check the well-formedness of the URL by running Uri.IsWellFormedUriString(copy.Link, UriKind.Absolute)?

/// Gets or sets the Webpush options that will be included in the message.
/// </summary>
[JsonProperty("fcm_options")]
public WebpushFcmOptions Options { get; set; }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I missed this in my previous review. Lets rename this property to FcmOptions to be consistent with other languages (namely Node.js and Go).

hiranya911 self-assigned this Jun 3, 2019

Odonno commented Jun 3, 2019

Copy link
Copy Markdown
Contributor Author

@hiranya911 Thank you for your help on this.

hiranya911 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Found a small bug in the new validation logic. I can merge once that's fixed.

hiranya911 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM 👍

hiranya911 merged commit b54e7ea into firebase:master Jun 3, 2019
Odonno deleted the feat/fcm_options branch June 4, 2019 06:52
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL