• <bdo id='CnqHu'></bdo><ul id='CnqHu'></ul>
  • <legend id='CnqHu'><style id='CnqHu'><dir id='CnqHu'><q id='CnqHu'></q></dir></style></legend>
  • <i id='CnqHu'><tr id='CnqHu'><dt id='CnqHu'><q id='CnqHu'><span id='CnqHu'><b id='CnqHu'><form id='CnqHu'><ins id='CnqHu'></ins><ul id='CnqHu'></ul><sub id='CnqHu'></sub></form><legend id='CnqHu'></legend><bdo id='CnqHu'><pre id='CnqHu'><center id='CnqHu'></center></pre></bdo></b><th id='CnqHu'></th></span></q></dt></tr></i><div id='CnqHu'><tfoot id='CnqHu'></tfoot><dl id='CnqHu'><fieldset id='CnqHu'></fieldset></dl></div>

    <small id='CnqHu'></small><noframes id='CnqHu'>

        <tfoot id='CnqHu'></tfoot>

        在库中实现 Firebase

        时间:2023-07-31

          <i id='SIMfw'><tr id='SIMfw'><dt id='SIMfw'><q id='SIMfw'><span id='SIMfw'><b id='SIMfw'><form id='SIMfw'><ins id='SIMfw'></ins><ul id='SIMfw'></ul><sub id='SIMfw'></sub></form><legend id='SIMfw'></legend><bdo id='SIMfw'><pre id='SIMfw'><center id='SIMfw'></center></pre></bdo></b><th id='SIMfw'></th></span></q></dt></tr></i><div id='SIMfw'><tfoot id='SIMfw'></tfoot><dl id='SIMfw'><fieldset id='SIMfw'></fieldset></dl></div>

            <tbody id='SIMfw'></tbody>

          <legend id='SIMfw'><style id='SIMfw'><dir id='SIMfw'><q id='SIMfw'></q></dir></style></legend>
        1. <small id='SIMfw'></small><noframes id='SIMfw'>

              • <bdo id='SIMfw'></bdo><ul id='SIMfw'></ul>
                1. <tfoot id='SIMfw'></tfoot>
                  本文介绍了在库中实现 Firebase的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我想在我想在许多应用程序中用作 SDK 的库中实现 Friebase 通知系统.

                  I want to implement Friebase notifications system inside a library that I want to use as SDK in many apps.

                  Firebase 现在要求提供应用 ID,但我在库中实现它,因此没有应用 ID.

                  Firebase is asking now for an App ID, but I'm implementing it inside a library thus no App Id.

                  如何实现向使用我的库的应用发送通知的目标?

                  How could I achieve my goal to be able to send notifications to my apps that use my library ?

                  提前致谢.

                  推荐答案

                  是的,您实际上可以这样做,在您的库中 build.gradle 将其放在 defaultConfig 字段中

                  Yes you can actually do this, on your library build.gradle put this inside the defaultConfig field

                  buildConfigField("String", "FIREBASE_APP_KEY", ""${firebaseAppKey}"")
                  

                  然后在你项目的 gradle.properties

                  firebaseAppKey = <yourFirebaseAppSecret>;

                  对于 每个 项目/应用,您必须在 gradle.properties 上定义此变量.

                  For each project/app you must define this variable on your gradle.properties.

                  您必须为每个项目创建一个 Firebase 应用,但您的库现在可以拥有 Firebase SDK.

                  You'll have to create a firebase app for each project, but your library can now have the Firebase SDK.

                  当您想访问此环境变量值时,请使用 BuildConfig.FIREBASE_APP_KEY(例如,实例化 firebase).

                  When you want to access this environment variable value use BuildConfig.FIREBASE_APP_KEY (e.g. instantiate firebase).

                  这篇关于在库中实现 Firebase的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:Firebase 与 GCM 的向后兼容性 下一篇:Firebase Cloud Messaging (FCM) - 当用户点击带有附加功能的通知时启动活动

                  相关文章

                      <legend id='vfalI'><style id='vfalI'><dir id='vfalI'><q id='vfalI'></q></dir></style></legend>

                      <tfoot id='vfalI'></tfoot>

                        <bdo id='vfalI'></bdo><ul id='vfalI'></ul>
                      <i id='vfalI'><tr id='vfalI'><dt id='vfalI'><q id='vfalI'><span id='vfalI'><b id='vfalI'><form id='vfalI'><ins id='vfalI'></ins><ul id='vfalI'></ul><sub id='vfalI'></sub></form><legend id='vfalI'></legend><bdo id='vfalI'><pre id='vfalI'><center id='vfalI'></center></pre></bdo></b><th id='vfalI'></th></span></q></dt></tr></i><div id='vfalI'><tfoot id='vfalI'></tfoot><dl id='vfalI'><fieldset id='vfalI'></fieldset></dl></div>

                      <small id='vfalI'></small><noframes id='vfalI'>