Skip to content

BatchResponse

chad63e edited this page Jan 29, 2024 · 1 revision

BatchResponse

Class Description

BatchResponse is an Anvil-specific Python wrapper class designed to handle batch responses from Firebase Cloud Messaging (FCM) operations. It serves as a converter, turning Firebase batch response data into a format more native and convenient for Anvil applications. This class is typically used for interpreting responses from batch message sending operations in FCM and is not instantiated directly by developers.

Attributes

  • responses (list[Response]): A list of Response objects, each representing the outcome of an individual message operation within the batch.
  • success_count (int): The number of successful message operations in the batch.
  • failure_count (int): The number of failed message operations in the batch.

Interaction with FCM Batch Responses

Developers interact with BatchResponse instances when dealing with the results of batch messaging operations in FCM. These instances are automatically created and returned by the Anvil Firebase wrapper when sending a batch of messages.

Usage Scenario

  • When sending multiple messages as a batch via FCM using Anvil's Firebase wrapper, the collective response is automatically converted to a BatchResponse instance.
  • Developers can then use this class to assess the overall success of the batch operation, as well as inspect individual responses for detailed insights.