C# Send notification to device group with unique custom data FCM(C# 向具有唯一自定义数据 FCM 的设备组发送通知)
问题描述
我知道我可以将 registration_ids
提供给 JSON 请求,以字符串数组的形式发送到多个设备.但是,我有一个唯一的令牌,我想将它发送给每个 registration_ids
.如何在不简单地循环发送我希望发送到的设备数量的发送请求的情况下实现这一点:
I am aware that I can supply registration_ids
to the JSON request to send to multiple devices in the form of string arrays. However, I have a unique token that I want to send to each of those registration_ids
. How can I achieve that without simply looping the send request for the number of devices I wish to send to:
registration_ids: [1,2,3,4,5]
data: {
//if id==1, include the necessary token I wish to include.
}
推荐答案
不幸的是,如果您尝试向每个用户发送独特的内容,则必须分别发送每个独特的有效负载.
Unfortunately, if you are attempting to send something unique to each user, you'll have to send each unique payload separately.
我能想到的(只是假设一个场景)是让您发送一个特定的参数(某种 ID)并让客户端应用程序根据用户对其进行解释.希望这是有道理的.
What I can think of (just assuming a scenario) is for you to send a specific parameter (an ID of some sort) and have the client app interpret it depending on the user. Hope that makes sense.
这篇关于C# 向具有唯一自定义数据 FCM 的设备组发送通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:C# 向具有唯一自定义数据 FCM 的设备组发送通知


基础教程推荐
- 有没有办法忽略 2GB 文件上传的 maxRequestLength 限制? 2022-01-01
- rabbitmq 的 REST API 2022-01-01
- 如何激活MC67中的红灯 2022-01-01
- 为什么Flurl.Http DownloadFileAsync/Http客户端GetAsync需要 2022-09-30
- 如何在 IDE 中获取 Xamarin Studio C# 输出? 2022-01-01
- 将 Office 安装到 Windows 容器 (servercore:ltsc2019) 失败,错误代码为 17002 2022-01-01
- 将 XML 转换为通用列表 2022-01-01
- c# Math.Sqrt 实现 2022-01-01
- SSE 浮点算术是否可重现? 2022-01-01
- MS Visual Studio .NET 的替代品 2022-01-01