osama mostafa
osama mostafa

Reputation: 31

i'm trying to subscribe one device to multiple topics in flutter but it is not working

i'm trying to loop on listOfStringAnswers which contains list of strings , but when i debug it gives me exception : 'isValidTopic': is not true.

Future topicFunc() async {

  for (var element in listOfStringAnswers)
  {
    await FirebaseMessaging.instance.subscribeToTopic(element);
  }

}

Upvotes: 0

Views: 191

Answers (1)

osama mostafa
osama mostafa

Reputation: 31

Solved , i removed quotation marks from strings , after that it worked , because the string letters were surrounded with two quotation marks not only one quotation mark

Upvotes: 1

Related Questions