我正在使用 https://dev.to/serhii_korol_ab7776c50dba/creating-push-notifications-for-android-in-net-maui-2ak4 示例来发送具有特定主题的 FCM 消息。
FirebaseMessaging messaging = FirebaseMessaging.GetMessaging(app);
var message = new Message()
{
Topic = "my_topic123",
Data = _Data,
Android = new AndroidConfig { Priority = Priority.High },
}
string response = await messaging.SendAsync(message);
问题是,无论是否注册另一个主题,我都会收到所有主题:
FirebaseMessaging.Instance.SubscribeToTopic("my_topic");
我需要执行什么操作才能仅接收我订阅的特定主题?