subscribeToTopic static method
To subscribe to a topic, call subscribeToTopic() with the topic name. This method returns a Future, which resolves when the subscription succeeded:
Implementation
static subscribeToTopic(String topic) {
FirebaseMessaging.instance.subscribeToTopic(topic);
}