android – GCM API Key是否应该保密?

android – GCM API Key是否应该保密?,第1张

概述根据 documentation: Do not include the API key anywhere in your client code. 在我们当前的Android应用程序中就是这种情况 – API Key无法包含在代码中.但是,对于新版本3.0.0的com.google.gms:google-services库,它开始抛出错误aping_key / current_key而没有它,如 根据 documentation:

Do not include the API key anywhere in your clIEnt code.

在我们当前的AndroID应用程序中就是这种情况 – API Key无法包含在代码中.但是,对于新版本3.0.0的com.Google.gms:Google-services库,它开始抛出错误aPing_key / current_key而没有它,如下所述:Missing api_key/current key with Google Services 3.0.0.

此外,Google的配置生成器https://developers.google.com/mobile/add?platform=android&cntapi=gcm在Google-services.Json文件中包含API密钥.

它应该被保密吗?或者将它包含在客户端应用程序中是否安全?

解决方法 Google-services.Json文件代表Firebase中所有可用服务的配置.有一些服务需要和“AndroID”API密钥.这些是您可以在Google-services.Json文件中找到的API密钥.您的应用可能会也可能不会使用这些API密钥,具体取决于您的应用使用的Firebase API.

FCM有一个“服务器”API密钥,用于发送消息,此API密钥不是Google-services.Json文件中包含的密钥.服务器API密钥永远不应包含在您的应用程序中.但是,Google服务插件会在构建时查找这些AndroID API密钥,这可能是导致错误的原因,这不是因为您的FCM服务器API密钥丢失.

总结

以上是内存溢出为你收集整理的android – GCM API Key是否应该保密?全部内容,希望文章能够帮你解决android – GCM API Key是否应该保密?所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://www.outofmemory.cn/web/1130584.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-30
下一篇 2022-05-30

发表评论

登录后才能评论

评论列表(0条)

保存