(I post my comments in response)
In most cases, creating an FCM TOPIC for each user is not a good idea.
Messages sent to FCM TOPICS are publicly available. Any user (even from another application) can subscribe to / themes / {username} and receive their messages.
Example:
Another developer may copy the google-services.json file from your apk.
Then he can subscribe to any topic.
In order to intercept your user messages, the attacker still needs to guess {username} or any other identifier that you use. But if you suspect that this might happen, the problem will be big because you will never know if anyone is getting a copy of your messages, and you usually never change {username}.
This is not an FCM security issue. This is part of the theme API design.
If you need secure messages, you can send them directly to the device token.
If you still want to make one topic for each user, be careful not to send sensitive data or data that should not be intercepted by third parties.
source share