英文:
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
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论