C# 向具有唯一自定义数据 FCM 的设备组发送通知 [英] C# Send notification to device group with unique custom data FCM

查看:31
本文介绍了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 的设备组发送通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆