Java, Firebase, 请求通知权限

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

Java, Firebase, Request notification permission

问题

我想知道是否有一种方式可以在Java中为Web应用程序请求用户权限,使用Firebase(或其他方式,但我需要获取令牌)。我已经知道在JavaScript中的方式(firebase.messaging().requestPermission())。

英文:

I am wondering if there is a way to request user permission with Firebase (or anything else but I need to get the token) in Java for a webApp.
I already know the way in Javascript (firebase.messaging().requestPermission()).

答案1

得分: 1

请求接收通知的权限必须在将显示这些通知的客户端上进行。由于在JVM应用程序中没有接收通知的方法,因此在那里没有请求权限的API。

英文:

The request for permission to receive notifications must happen on the client that will display those notifications. Since there is no way to receive notifications in a JVM application, there is no API to request permissions there.

huangapple
  • 本文由 发表于 2020年8月4日 01:30:22
  • 转载请务必保留本文链接:https://go.coder-hub.com/63234253.html
匿名

发表评论

匿名网友

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

确定