Skip to content
This repository was archived by the owner on Apr 17, 2026. It is now read-only.
This repository was archived by the owner on Apr 17, 2026. It is now read-only.

firebase topic condition not expression doesn't work #11

Description

@jiamo

I have a lib https://github.com/jiamo/pfcm to use firebase cloud message.

def test_pfcm_send_topic_include_not2():
    message_title = "topic"
    message_body = "{} body of message".format(datetime.datetime.now())

    fsmapi = FcmAPI(project_name, private_file)
    pfcm = Pfcm(fsmapi)
    topic = "!('test' in topics)"
    results = pfcm.send_msg(
        topic_condition=topic,
        message_title=message_title,
        message_body=message_body)

    for result in results:
        print(result)
        assert not "error"  in result

Got error:

F{
  "error": {
    "code": 400,
    "message": "Request contains an invalid argument.",
    "status": "INVALID_ARGUMENT",
    "details": [
      {
        "@type": "type.googleapis.com/google.rpc.BadRequest",
        "fieldViolations": [
          {
            "field": "message.condition",
            "description": "Invalid condition expression provided."
          }
        ]
      },
      {
        "@type": "type.googleapis.com/google.firebase.fcm.v1.FcmError",
        "errorCode": "INVALID_ARGUMENT"
      }
    ]
  }
}


print the playload json: I already send email to firebase support(They said they are confirm it and need to wait to fix but don't know when)

'{"message": {"notification": {"title": "topic", "body": "2018-03-27 12:24:23.399014 body of message"}, "condition": "!(\'test\' in topics) && (\'test2\' in topics)"}}'

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions