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

查看:351
本文介绍了C#使用唯一的自定义数据FCM向设备组发送通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道我可以向JSON请求提供 registration_ids 以字符串数组的形式发送给多个设备。但是,我有一个唯一的标记,我想发送给每个 registration_ids 。我怎样才能做到这一点,而不是简单地循环发送请求我希望发送到的设备数量:
$ b $ pre $登记ID:[1 ,2,3,4,5]
data:{
// if id == 1,include include the necessary token,I want to include。


解决方案

不幸的是,如果你正在尝试发送每个用户独特的东西,你必须分别发送每个独特的有效载荷。



我能想到的(只是假设一个场景)是给你发送一个特定的参数(某种类型的ID),并让客户端应用程序根据用户来解释它。希望有道理。


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.

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天全站免登陆