从Firebase远程配置中检索FCM服务器密钥 [英] Retrieve the FCM server key from the Firebase remote configuration

查看:186
本文介绍了从Firebase远程配置中检索FCM服务器密钥的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于一个小项目,我想直接从应用程序发送推送通知(无后端).

For a little project I want to send push notifications directly from the app (without a backend).

当我从FCM文档中读取内容时,尽管在技术上可以通过一个简单的HTTP POST请求来实现,但我们不建议这样做,因为这样我就必须对服务器密钥进行硬编码,而通过一些逆向工程就可以轻松地检索该服务器密钥.

As I read from the FCM documentation while this is technically possible with a simple HTTP POST request it's discouraged because in this way I have to hard-code the server key that will become easily retrievable with a little of reverse engineering.

所以我虽然将服务器密钥添加到Firebase远程配置中并使用它.

So I though to add my server key in the Firebase remote configuration and use that.

您怎么看?有禁忌症吗?

What do you think? Are there some contraindications?

非常感谢您.

推荐答案

将密钥存储在Firebase远程配置中并不能确保该方法的安全性.毕竟:该应用仍然需要能够访问密钥,从而可以访问远程配置.

Storing the key in Firebase Remote Config doesn't make the approach secure. After all: the app still needs to be able to access the key and thus remote config.

任何在客户端代码中使用服务器密钥的解决方案都容易受到滥用.

Any solution that uses the server key in the client-side code is susceptible to abuse.

这篇关于从Firebase远程配置中检索FCM服务器密钥的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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