仅将 Firesharp 用于 Windows 桌面推送通知 [英] Using Firesharp for Windows desktop push notifications only

查看:27
本文介绍了仅将 Firesharp 用于 Windows 桌面推送通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在 Windows 桌面应用程序中使用 Firesharp.应用程序只会接收来自 Firebase 的通知,不会有任何类型的数据库交互(Firebase Cloud Messaging/FCM 是 Firebase 唯一使用的东西),也不会有网络/Firebase 数据库.Windows 应用程序将订阅项目中的特定主题,并将不断监视它以获取新消息.

I want to use Firesharp in a desktop application for Windows. The application will only receive notifications from Firebase, and there will be no database interactions of any kind (Firebase Cloud Messaging / FCM is the only thing used from Firebase), nor will there be a web / Firebase database. The Windows application will be subscribed to a specific topic in the project, and will constantly monitor it for new messages.

我的问题是我不确定如何创建 官方 Firesharp 示例,因为它是关于连接到网络数据库(我不需要):

My problem is that I'm unsure how to create the config object shown in the official Firesharp example, since it's about connecting to the web database (which I don't need):

IFirebaseConfig config = new FirebaseConfig
{
   AuthSecret = "your_firebase_secret",
   BasePath = "https://yourfirebase.firebaseio.com/"
};

IFirebaseClient  client = new FirebaseClient(config);

假设我最初想对我的凭据进行硬编码,我如何创建配置/连接对象以将推送通知发送到特定主题?

Assuming that I initially want to hardcode my credentials, how can I create the config / connection object for sending push notifications to a specific topic?

我猜我需要服务器密钥和某种包含主题的 FCM URL,但我不知道如何去做.

I'm guessing that I need the server key and some sort of a FCM URL with the topic included, but I have no idea how to go about this.

我已经下载了完整的 GitHub 项目,并查看了文件(对 fcm、push、notification、googleapis、path 进行字符串搜索),我唯一发现的是使用 <appname>.firebaseio.com.

I've downloaded the complete GitHub project, and looked through the files (string search for fcm, push, notification, googleapis, path), and the only thing I've found is the use of <appname>.firebaseio.com.

推荐答案

据我所知,您使用的 FireSharp 库仅封装了 Firebase 实时数据库 API.它不封装任何其他 Firebase 服务,例如 Firebase Cloud Messaging.

The FireSharp library that you use only wraps the Firebase Realtime Database API as far as I see. It doesn't wrap any other Firebase services, such as Firebase Cloud Messaging.

此外:仅在 Android 和 iOS 设备上才能接收 FCM 消息.不支持在 Windows 上接收消息.请参阅将 Firebase 云消息传递与 Windows 应用程序结合使用

In addition: receiving FCM messages is only possible on Android and iOS devices. There is no support for receiving messages on Windows. See Using Firebase Cloud Messaging with Windows Application

这篇关于仅将 Firesharp 用于 Windows 桌面推送通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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