Skip to content

Defination of payload #155

@SurajBhari

Description

@SurajBhari

I am new to this webdev thing.
I was making a small project that requires me to send notification(s).
I have managed to get through everything and get it to send notification.

Readme says "data" can be anything serial. even serialized JSON
but when I send a message like this it arrives as it is

Is there any documents where you find the payload keys names?

image

my code is simple.

def send_web_push(subscription_information, message_body):
    return webpush(
        subscription_info=subscription_information,
        data=message_body,
        vapid_private_key=VAPID_PRIVATE_KEY,
        vapid_claims=VAPID_CLAIMS
    )

notification_payload = {
            "title": "New Video",
            "body": "New Video from xyz",
}
data = json.dumps(notification_payload)
send_web_push(sub, data)

Metadata

Metadata

Assignees

No one assigned

    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