subscribeToTopic method

Future<MessagingTopicManagementResponse> subscribeToTopic(
  1. List<String> registrationTokens,
  2. String topic
)

Subscribes a list of registration tokens to an FCM topic.

See Subscribe to a topic for code samples and detailed documentation.

  • registrationTokens: A list of registration tokens to subscribe to the topic.
  • topic: The topic to which to subscribe.

Returns a Future fulfilled with the server's response after the registration tokens have been subscribed to the topic.

Implementation

Future<MessagingTopicManagementResponse> subscribeToTopic(
  List<String> registrationTokens,
  String topic,
) {
  return _requestHandler.subscribeToTopic(registrationTokens, topic);
}