8000 message.android.notification.sticky encoded as 1 throughs ValidationErrror · Issue #369 · firebase/firebase-admin-python · GitHub
[go: up one dir, main page]

Skip to content
message.android.notification.sticky encoded as 1 throughs ValidationErrror #369
Closed
@tonythomas01

Description

@tonythomas01

[REQUIRED] Step 2: Describe your environment

  • Operating System version: 10.15.1 (19B88) Mac OS Catalina
  • Firebase SDK version: 3.2.0
  • Library version: 3.2.0 ?
  • Firebase Product: Android Notification

[REQUIRED] Step 3: Describe the problem

Steps to reproduce:

  1. Try creating a notification with sticky=True for Android.
  2. See that it throws a ValidationError

Relevant Code:

    android_config = messaging.AndroidConfig(
        priority="high",
        notification=messaging.AndroidNotification(
            body=body,
            title=title,
            icon=icon, image=image, sticky=True
        ),
        data=custom,
    )

Throws

  File "/home/vagrant/.local/lib/python2.7/site-packages/firebase_admin/messaging.py", line 117, in send
    return _get_messaging_service(app).send(message, dry_run)
  File "/home/vagrant/.local/lib/python2.7/site-packages/firebase_admin/messaging.py", line 355, in send
    raise self._handle_fcm_error(error)
firebase_admin.exceptions.InvalidArgumentError: Invalid value at 'message.android.notification.sticky' (TYPE_BOOL), 1

Debugging shows:

firebase_admin._message_encoder.py
    @classmethod
    def encode_boolean(cls, value):
        """Encodes a boolean into JSON."""
        if value is None:
            return None
        return 1 if value else 0

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0