Skip to content

TopicManagementResponse

chad63e edited this page Jan 29, 2024 · 1 revision

TopicManagementResponse

Class Description

TopicManagementResponse is an Anvil portable class designed as a Python wrapper for Firebase Cloud Messaging (FCM) topic management responses. It converts the native Firebase response into a format that is more accessible and easier to handle within Anvil applications. This class is typically used to interact with the results of topic subscription and unsubscription operations in FCM. Developers do not instantiate this class directly but interact with it when processing responses from topic management actions.

Attributes

  • success_count (int): The number of successful operations (subscriptions or unsubscriptions) in the response.
  • failure_count (int): The number of failed operations in the response.
  • errors (list): A list of errors encountered during the operations, if any.

Interaction with FCM Topic Management Responses

Developers will commonly interact with instances of TopicManagementResponse when handling the outcomes of topic subscription or unsubscription operations via FCM. These instances provide a clear and structured way to assess the success and failures of these operations.

Usage Scenario

  • When subscribing or unsubscribing devices to/from topics in FCM using Anvil's Firebase wrapper, the response is automatically converted to a TopicManagementResponse instance.
  • Developers can then use the attributes of this class to determine the number of successful and failed operations and to understand any errors that occurred.