8000 Add support for "webpush.fcm_options" (WebpushFcmOptions) by robertu7 · Pull Request #203 · firebase/firebase-admin-python · GitHub
[go: up one dir, main page]

Skip to content

Add support for "webpush.fcm_options" (WebpushFcmOptions) #203

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

Closed
wants to merge 2 commits into from

Conversation

robertu7
Copy link
@robertu7 robertu7 commented Oct 5, 2018

Resolved #202

@googlebot
Copy link

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

@googlebot
Copy link

CLAs look good, thanks!

Copy link
Contributor
@hiranya911 hiranya911 left a comment

Choose a reason for hiding this comment

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

Thanks @robermac for the PR. A few changes required before we can merge this.

@@ -622,6 +636,7 @@ def encode_webpush(cls, webpush):
'headers': _Validators.check_string_dict(
'WebpushConfig.headers', webpush.headers),
'notification': cls.encode_webpush_notification(webpush.notification),
'fcm_options': cls.encode_webpush_fcm_options(webpush.fcm_options)
Copy link
Contributor

Choose a reason for hiding this comment

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

The json key should be called fcmOptions. The REST API documentation mentions fcm_options by error and the FCM team is going to fix it.

return None
if not isinstance(fcm_options, WebpushFcmOptions):
raise ValueError('WebpushConfig.fcm_options must be an instance of '
'WebFcmOptions class.')
Copy link
Contributor

Choose a reason for hiding this comment

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

WebpushFcmOptions

raise ValueError('WebpushConfig.fcm_options must be an instance of '
'WebFcmOptions class.')
result = {
'link': _Validators.check_string(
Copy link
Contributor

Choose a reason for hiding this comment

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

Also check for https:// prefix.

check_encoding(messaging.Message(
topic='topic', webpush=messaging.WebpushConfig(fcm_options=fcm_options)))
return excinfo

Copy link
Contributor

Choose a reason for hiding this comment

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

Also add a test case to verify the happy path.

@hiranya911
Copy link
Contributor

Closing this in favor of the c 8E16 hanges being implemented in https://github.com/firebase/firebase-admin-python/tree/hkj-fcm-options

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
0