Firebase消息上行消息Unity没有’Send’命令

huangapple go评论72阅读模式
英文:

Firebase Messaging Upstream Messaging Unity has no 'Send' command

问题

I understand that you want a translation of the provided text. Here's the translated text:

我正在按照下一页的指导。我无法使用Send。我应该怎么做?

当我向ChatGPT询问时,他们告诉我要使用SendAsync,但没有这样的命令。所以我正在尝试通过Post发送,但这并不容易。看起来我需要进行身份验证,但无论我如何查看文档,我对Google身份验证的实现不太熟悉。

英文:

https://firebase.google.com/docs/cloud-messaging/unity/upstream?hl=ko

I am following the next page. I can't use Send. What should I do?

Firebase.Messaging.Message message;
message.To = SENDER_ID + "@fcm.googleapis.com";
message.MessageId = get_unique_message_id();
message.Data("my_message", "Hello World");
message.Data("my_action", "SAY HELLO");
message.TimeToLive = kTimetoLive;
Firebase.Messaging.FirebaseMessaging.Send(message);

When I asked ChatGPT, they told me to use SendAsync, but there is no such command.
So I'm trying to send it by Post, but it's not easy.
It looks like I need to be authenticated, but no matter how much I look at the documentation,
I'm not familiar with the implementation of Google Authentication.

答案1

得分: 0

Sending upstream messages through FCM is exceedingly uncommon these days, and the wish to use it is mostly based on misunderstanding what it does. Sending an upstream message through XMPP delivers that message to your app server that listens for those messages. Is is not a way to send a message from one device to another device.

Sending a message to a device must always be done from a trusted environment, such as your development machine, a server that you control, or something like Cloud Functions/Cloud Run.

For more on this, also check out: https://stackoverflow.com/questions/37990140/how-to-send-one-to-one-message-using-firebase-messaging

英文:

Sending upstream messages through FCM is exceedingly uncommon these days, and the wish to use it is mostly based on misunderstanding what it does. Sending an upstream message through XMPP delivers that message to your app server that listens for those messages. Is is not a way to send a message from one device to another device.

Sending a message to a device must always be done from a trusted environment, such as your development machine, a server that you control, or something like Cloud Functions/Cloud Run.

For more on this, also check out: https://stackoverflow.com/questions/37990140/how-to-send-one-to-one-message-using-firebase-messaging

huangapple
  • 本文由 发表于 2023年5月13日 11:35:54
  • 转载请务必保留本文链接:https://go.coder-hub.com/76240955.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定