C# 向具有唯一自定义数据 FCM 的设备组发送通知

C# Send notification to device group with unique custom data FCM(C# 向具有唯一自定义数据 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 的设备组发送通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

DispatcherQueue null when trying to update Ui property in ViewModel(尝试更新ViewModel中的Ui属性时DispatcherQueue为空)
Drawing over all windows on multiple monitors(在多个监视器上绘制所有窗口)
Programmatically show the desktop(以编程方式显示桌面)
c# Generic Setlt;Tgt; implementation to access objects by type(按类型访问对象的C#泛型集实现)
InvalidOperationException When using Context Injection in ASP.Net Core(在ASP.NET核心中使用上下文注入时发生InvalidOperationException)
LINQ many-to-many relationship, how to write a correct WHERE clause?(LINQ多对多关系,如何写一个正确的WHERE子句?)