Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firebase Clouding Messaging : Call subscribeToTopic method multiple times

I'm using FCM for Topic Messaging on Android.

If I call the FirebaseMessaging.getInstance().subscribeToTopic("news") multiple times to subscribe 'news' topic, what will happen?

I spent my time searching for it but I couldn't. I'm using that method in my MainActivity so It's called every time when app is launched. In my experience It's not problem to get push messages and I couldn't find out any problems yet. But I wanna know it exactly when I call it multiple times.

like image 712
hshan Avatar asked Dec 22 '16 04:12

hshan


1 Answers

You can only be subscribed to a topic once.

Additional calls to subscribeToTopic() for the same topic are essentially no-ops, they make no difference.

like image 88
Frank van Puffelen Avatar answered Sep 28 '22 08:09

Frank van Puffelen