Skip to content

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.

'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 changes 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

3 participants