在Java Cross Platform Desktop应用程序上接收推送通知 [英] Receive push notifications on a Java Cross Platform Desktop app

查看:41
本文介绍了在Java Cross Platform Desktop应用程序上接收推送通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Javafx开发Java桌面应用程序,并且试图从服务器接收推送通知.我的第一种方法是使用Firebase.我已经连接到Firebase,甚至出于测试目的而实现了将数据存储在Firebase数据库中的目的.但是我真正需要的目标是接收推送通知.

I'm developing a Java Desktop App, using Javafx and I'm trying to receive push notifications from a server. My first approach was to use firebase. I already connected to firebase and even achieve, for test purpose, storing data in firebase database. But the goal I really need is to receive push notifications.

我正在使用firebase-admin:6.5.0,但是此模块未向我提供我需要接收通知的FirebaseMessagingService类.

I'm using firebase-admin:6.5.0, but this module doesn't provide me the FirebaseMessagingService class that I need to receive notifications.

我也尝试使用firebase-messaging,但在导入后出现带下划线的错误.

I also tried to use firebase-messaging but appear with an error underline after de import.

我做错了什么?甚至可以在具有Firebase的Java Desktop应用程序中接收推送通知?我有什么选择?

What I'm doing wrong? It´s even possible to receive push notifications in a Java Desktop app with firebase? What alternative do I have?

提前谢谢

推荐答案

Java客户端中没有SDK可以接收 Firebase Cloud Messaging通知.考虑使用另一种技术来传递通知,例如Firebase实时数据库或Cloud Firestore.

There is no SDK to receive Firebase Cloud Messaging notifications in a Java client. Consider using another technology to deliver the notifications, such as the Firebase Realtime Database, or Cloud Firestore.

您使用的Admin SDK授予对整个Firebase项目的填充管理访问权限.它旨在用于受信任的环境,例如开发计算机或您控制的服务器.

The Admin SDK you use grants fill administrative access to your entire Firebase project. It is meant for use on trusted environments, such as your development machine, or a server you control.

另请参阅:

这篇关于在Java Cross Platform Desktop应用程序上接收推送通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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