[Python] Send push notification to many users via python

Discussão em 'Python' iniciado por Stack, Janeiro 27, 2025.

  1. Stack

    Stack Membro Participativo

    For my project using Firebase messaging to send push notification. I have users's firebase tokens stored on the database. Using them I sent push to each user. Total time of sending is about 100 seconds for 100 users. Is there way to send push asynchronously(I mean at one time to send many push notifications)

    # Code works synchronously
    for user in users:
    message = messaging.Message(
    notification=messaging.Notification(
    title="Push title",
    body="Push body"
    ),
    token = user['fcmToken']
    )

    response = messaging.send(message)

    Continue reading...

Compartilhe esta Página