简体   繁体   English

如何获取 firebase firestore 配置的 googleappid?

[英]how to get googleappid for firebase firestore config?

I am trying to create a flutter application which connects to firestore to store and retrieve data.我正在尝试创建一个 flutter 应用程序,它连接到 firestore 以存储和检索数据。 from the flutter cloud_firestore plugin docs, i can see that i need some values to configure it.从 flutter cloud_firestore 插件文档,我可以看到我需要一些值来配置它。

final FirebaseApp app = await FirebaseApp.configure(
    name: 'test',
    options: const FirebaseOptions(
           googleAppID: '1:79601577497:ios:5f2bcc6ba8cecddd',
           gcmSenderID: '79601577497',
           apiKey: 'AIzaSyArgmRGfB5kiQT6CunAOmKRVKEsxKmy6YI-G72PVU',
           projectID: 'flutter-firestore',
        ),
    );

I know how to fetch the gcmSenderID, apiKey and projectID, but i am not able to understand how to get the googleAppID.我知道如何获取 gcmSenderID、apiKey 和 projectID,但我无法理解如何获取 googleAppID。

Please advice final Firestore firestore = new Firestore(app: app);请告知 final Firestore firestore = new Firestore(app: app);

as @martin-zeitler suggested, the id is availabile in the downloaded google-services.json file. 正如@ martin-zeitler建议的那样,该ID在下载的google-services.json文件中可用。 thanks for pointing it out. 感谢您指出。

You can get gcmsenderId from this link 您可以从此链接获取gcmsenderId

在此处输入图片说明

Login to firebase --> cog wheel next to Project Overview --> Project settings --> scroll down to "Your apps" (add one if missing) --> will show "SDK setup and configuration"登录到 firebase --> 项目概述旁边的齿轮 --> 项目设置 --> 向下滚动到“您的应用程序”(如果缺少则添加一个) --> 将显示“SDK 设置和配置”

在此处输入图像描述

Rename AppID to googleAppID on FirebaseOptions在 FirebaseOptions 上将 AppID 重命名为 googleAppID

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何获取 firebase Firestore 文档 ID - How to get the firebase firestore document id 如何从 Firebase Firestore 获取自定义 object? - How to get a custom object from Firebase Firestore? 如何从 Firebase 配置中获取 measurementId? - How to get the measurementId from the Firebase config? 如何获取firebase firestore中完整的文档路径? - How to get the complete document path in firebase firestore? 如何从 Android 上的 Firebase Firestore 获取嵌套集合? - How to get nested collection from Firebase Firestore on Android? 如何获取 firebase firestore android 中某些字段的值? - How to get value of some field in firebase firestore android? Firebase 远程配置:如何在 Map 中获取所有配置<string, string></string,> - Firebase Remote Config: How to get all config in Map<String, String> 如何从 Firebase Firestore 获取地理点作为列表<latlng>对于 Flutter 中的折线?</latlng> - How to get geopoints from Firebase Firestore as List<LatLng> for a Polyline in Flutter? 如何在 Firebase Firestore 上获取一个字段? - How can I get one field on Firebase Firestore? 如何在 React 的 firebase firestore 中获取/生成当前时间戳 - How to get/generate current Timestamp in firebase firestore in React
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM