簡體   English   中英

如何獲取 firebase firestore 配置的 googleappid?

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

我正在嘗試創建一個 flutter 應用程序,它連接到 firestore 以存儲和檢索數據。 從 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',
        ),
    );

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

請告知 final Firestore firestore = new Firestore(app: app);

正如@ martin-zeitler建議的那樣,該ID在下載的google-services.json文件中可用。 感謝您指出。

您可以從此鏈接獲取gcmsenderId

在此處輸入圖片說明

登錄到 firebase --> 項目概述旁邊的齒輪 --> 項目設置 --> 向下滾動到“您的應用程序”(如果缺少則添加一個) --> 將顯示“SDK 設置和配置”

在此處輸入圖像描述

在 FirebaseOptions 上將 AppID 重命名為 googleAppID

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM