如何获取 firebase firestore 配置的 googleappid?

Vil*_*P P 5 firebase flutter google-cloud-firestore

我正在尝试创建一个连接到 firestore 来存储和检索数据的 flutter 应用程序。从 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',
        ),
    );
Run Code Online (Sandbox Code Playgroud)

我知道如何获取 gcmSenderID、apiKey 和 projectID,但我无法理解如何获取 googleAppID。

请告知 Final Firestore firestore = new Firestore(app: app);

Vil*_*P P 4

正如 @martin-zeitler 所建议的,该 ID 在下载的 google-services.json 文件中可用。感谢您指出。

  • 该文件中列出了一些 ID。如果知道哪一个特定的映射到 googleAppID 就好了。 (2认同)
  • 查找此键中的值 "client": [ { "client_info": { "mobilesdk_app_id": (2认同)