firebase消息传递条件无效的论点
我使用Firebase将通知发送给已订阅特定主题的多个设备。
要将通知发送到主题的组合,我使用以下“条件”:
String condition = "'TopicA' in topics && ('TopicB' in topics || 'TopicC' in topics || 'TopicD' in topics || 'TopicE' in topics) && ('TopicF' in topics || 'TopicG' in topics)"
Message message = Message.builder()
.setNotification(Notification.builder()
.setTitle("notificationTitle")
.setBody("notification body bla bla")
.build())
.setCondition(condition)
firebaseService.send(message)
如果条件仅包含5个主题,则可以正常工作,否则我会遇到错误:
HTTP Error: 400, Request contains an invalid argument.
据我了解,这是FCM中的一个错误,这仍然不是解决了
我在这里找到了一个解决方法: https://stackoverflow.com/a/52302136/47774302 条件为多种条件。
是否有一种自动化的方法将条件分成一组5人,并最少提出壁炉请求?
I use Firebase to send notifications to multiple devices that have subscribed to a particular topic.
To send a notification to a combination of topics, I use "conditions" as described below:
String condition = "'TopicA' in topics && ('TopicB' in topics || 'TopicC' in topics || 'TopicD' in topics || 'TopicE' in topics) && ('TopicF' in topics || 'TopicG' in topics)"
Message message = Message.builder()
.setNotification(Notification.builder()
.setTitle("notificationTitle")
.setBody("notification body bla bla")
.build())
.setCondition(condition)
firebaseService.send(message)
This works fine if the condition contains only 5 topics, otherwise I get an error:
HTTP Error: 400, Request contains an invalid argument.
as I understand it is a bug in FCM, which is still not resolved
I found a workaround here : https://stackoverflow.com/a/52302136/4774302, which consists in breaking a condition into several conditions.
Is there an automated way to break the condition into a group of 5, with a minimum of firebase requests ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论