還面臨其他挑戰或沒有看到下面列出的您的問題?請回報錯誤或請求功能並加入Stack Overflow討論。
Firebase 專案和 Firebase 應用
什麼是 Firebase 專案?
Firebase 專案是 Firebase 的頂級實體。在專案中,您可以註冊 Apple、Android 或 Web 應用程式。向 Firebase 註冊應用程式後,您可以將產品特定的 Firebase SDK新增至您的應用程式,例如 Analytics、Cloud Firestore、Crashlytics 或 Remote Config。
您應該在單一 Firebase 專案中註冊 Apple、Android 和 Web 應用程式變體。您可以使用多個 Firebase 專案來支援多種環境,例如開發、暫存和生產。
以下是一些用於詳細了解 Firebase 專案的資源:
- 了解 Firebase 專案- 簡要概述有關 Firebase 專案的幾個重要概念,包括它們與 Google Cloud 的關係以及專案及其應用和資源的基本層次結構。
- 設定 Firebase 專案的一般最佳實踐- 提供用於設定 Firebase 專案以及將應用程式註冊到專案的一般、高級最佳實踐,以便您擁有使用不同環境的清晰的開發工作流程。
請注意,對於所有 Firebase 項目,Firebase 會自動在 Google Cloud Console 中項目的標籤頁面中新增firebase:enabled
標籤。在我們的常見問題中了解有關此標籤的更多資訊。
什麼是 Google Cloud 組織?
Google Cloud 組織是 Google Cloud 專案(包括 Firebase 專案)的容器。此層次結構可以更好地組織、存取管理和審核您的 Google Cloud 和 Firebase 專案。有關更多信息,請參閱創建和管理組織。
如何將 Firebase 新增至現有 Google Cloud 專案?
您可能透過Google Cloud Console或Google API 控制台管理現有的 Google Cloud 專案。
您可以使用下列任一選項將 Firebase 新增至這些現有項目:
- 使用 Firebase 控制台:
在Firebase 控制台登入頁面中,點選新增項目,然後從項目名稱選單中選擇您的現有項目。 - 使用程式選項:
- 呼叫 Firebase 管理 REST API 端點
addFirebase
。 - 運行 Firebase CLI 指令
firebase projects:addfirebase
。 - 使用Terraform 。
- 呼叫 Firebase 管理 REST API 端點
為什麼我的 Google Cloud 專案有firebase:enabled
標籤?
在 Google Cloud Console 中專案的「標籤」頁面中,您可能會看到一個firebase:enabled
標籤(具體來說,是firebase
的Key
,其Value
enabled
)。
Firebase 會自動新增此標籤,因為您的專案是 Firebase 項目,這表示您的專案已為其啟用了 Firebase 特定的配置和服務。詳細了解Firebase 專案與 Google Cloud 之間的關係。
我們強烈建議您不要修改或刪除此標籤。 Firebase 和 Google Cloud 使用此標籤列出您的 Firebase 專案(例如,使用REST projects.list
端點或在 Firebase 控制台內的選單中)。
請注意,手動將此標籤新增至專案標籤清單中不會為您的 Google Cloud 專案啟用特定於 Firebase 的配置和服務。為此,您需要透過Firebase 控制台新增 Firebase(或者,對於高階用例,透過Firebase Management REST API或Firebase CLI )。
為什麼我的 Firebase 專案沒有顯示在我的 Firebase 專案清單中?
如果您在以下位置沒有看到您的 Firebase 項目,則此常見問題解答適用:
- 在您在 Firebase 控制台中查看的項目清單中
- 在呼叫REST API
projects.list
端點的回應中 - 在執行 Firebase CLI 指令
firebase projects:list
的回應中
試試以下故障排除步驟:
- 首先,嘗試直接存取項目的 URL 來存取您的專案。使用以下格式:
https://console.firebase.google.com/project/ PROJECT-ID /overview
- 如果您無法存取該項目或收到權限錯誤,請檢查以下內容:
- 確保您使用有權存取專案的相同 Google 帳戶登入 Firebase。您可以透過控制台右上角的帳戶頭像登入和登出 Firebase 控制台。
- 檢查您是否可以在Google Cloud Console中查看該項目。
- 確保您的專案在 Google Cloud Console 中專案的標籤頁面中具有
firebase:enabled
標籤。 Firebase 和 Google Cloud 使用此標籤列出您的 Firebase 專案。如果您沒有看到此標籤,但為您的專案啟用了 Firebase Management API ,請手動新增該標籤(具體來說,是firebase
的Key
,其Value
enabled
)。 - 確保為您指派了基本 IAM 角色(擁有者、編輯者、檢視者)之一或具有 Firebase 相關權限的角色,例如Firebase 預定義角色。您可以在 Google Cloud Console 的IAM頁面中查看您的角色。
- 如果您的專案屬於 Google Cloud 組織,您可能需要額外的權限才能查看 Firebase 控制台中列出的項目。請聯絡您的 Google Cloud 組織的管理人員,為您授予查看專案的適當角色,例如瀏覽器角色。
如果上述故障排除步驟都無法讓您在 Firebase 項目清單中看到您的項目,請聯絡Firebase 支援。
每個帳戶可以有多少個項目?
- Spark 定價方案 — 您的專案配額僅限於少量專案(通常約 5-10 個)。
- Blaze 定價方案 — 只要您的 Cloud Billing 帳戶信譽良好,每個 Cloud Billing 帳戶的專案配額就會大幅增加。
大多數開發人員很少關心專案配額的限制,但如果需要,您可以要求增加專案配額。
請注意,完全刪除項目需要 30 天,並且會計入您的配額,直到完全刪除為止。
一個 Firebase 專案中可以有多少個 Firebase 應用程式?
Firebase 專案是跨 Apple、Android 和 Web 的 Firebase 應用程式的容器。 Firebase 將 Firebase 專案中的 Firebase 應用程式總數限制為 30 個。
在此數字之後,效能開始下降(尤其是 Google Analytics),最終,在應用程式數量較多時,某些產品功能將停止運作。此外,如果您使用 Google 登入作為身份驗證提供程序,則會為專案中的每個應用程式建立基礎 OAuth 2.0 用戶端 ID。單一專案中最多可以建立 30 個左右的客戶端 ID。
您應該確保從最終用戶的角度來看,單一 Firebase 專案中的所有 Firebase 應用程式都是相同應用程式的平台變體。例如,如果您開發白標應用程序,則每個獨立標記的應用程式都應該有自己的 Firebase 項目,但該標籤的 Apple 和 Android 版本可以位於同一項目中。請閱讀我們有關設定 Firebase 專案的一般最佳實務中的更詳細指南。
在極少數情況下,您的專案需要超過 30 個應用程序,您可以要求增加應用程式限制。您的項目必須在 Blaze 定價計劃中才能提出此請求。造訪 Google Cloud Console提出您的請求並對其進行評估。請參閱 Google Cloud 文檔,以詳細了解配額管理。
如果我將我的專案標記為「生產」環境,會發生什麼情況?
在 Firebase 控制台中,您可以使用環境類型標記 Firebase 項目,可以是生產環境,也可以是未指定(非生產)環境。
將您的專案標記為環境類型不會影響您的 Firebase 專案的工作方式或其功能。但是,標記可以幫助您和您的團隊管理應用程式生命週期的各種 Firebase 專案。
如果您將項目標記為生產環境,我們會在 Firebase 控制台中向該項目添加顏色鮮豔的Prod標籤,提醒您任何更改都可能影響關聯的生產應用。未來,我們可能會為標記為生產環境的 Firebase 專案添加更多功能和保護措施。
若要變更 Firebase 專案的環境類型,請前往settings專案設定>常規,然後在環境下的您的專案卡中,按一下edit以變更環境類型。
在哪裡可以找到我的 Firebase 應用程式的應用程式 ID?
在 Firebase 控制台中,前往您的settings專案設定。向下捲動到「您的應用程式」卡,然後按一下所需的 Firebase 應用程式以查看應用程式的信息,包括其App ID 。
以下是一些應用程式 ID 值範例:
- Firebase iOS 應用程式:
1:1234567890:ios:321abc456def7890
- Firebase Android 應用程式:
1:1234567890:android:321abc456def7890
- Firebase Web 應用程式:
1:1234567890:web:321abc456def7890
將 Google Play/AdMob/Google Ads/BigQuery 連結到我的 Firebase 專案或應用程式有哪些先修條件?
- 要連結您的Google Play 帳戶,您需要以下內容:
- 以下 Firebase 角色之一:擁有者或 Firebase 管理員
和 - 以下任一 Google Play 存取等級:帳戶擁有者或管理員
- 以下 Firebase 角色之一:擁有者或 Firebase 管理員
- 要連結您的AdMob 應用,您需要同時是 Firebase 專案擁有者和 AdMob 管理員。
- 要關聯您的AdWords 帳戶,您需要同時是 Firebase 專案擁有者和 AdWords 管理員。
- 要連結您的BigQuery 項目,您需要是 Firebase 專案擁有者。
我應該在我的應用程式中包含哪些開源聲明?
在 Apple 平台上,Firebase pod 包含一個 NOTICES 文件,其中包含相關條目。 Firebase Android SDK 包含一個用於顯示許可證資訊的幫助程式Activity
。
Firebase 專案的權限和存取權限
如何為專案成員指派角色,例如擁有者角色?
若要管理指派給每個專案成員的角色,您必須是 Firebase 專案的擁有者(或被指派具有resourcemanager.projects.setIamPolicy
權限的角色)。
您可以在以下位置指派和管理角色:
- Firebase 控制台提供了一種在設定 >專案設定 的使用者和權限標籤settings向專案成員指派角色的簡化方法。在 Firebase 控制台中,您可以指派任何基本角色(擁有者、編輯者、檢視者)、 Firebase 管理員/檢視者角色或任何Firebase 預先定義產品類別角色。
- Google Cloud Console 提供了一組廣泛的工具,用於在IAM頁面中向專案成員分配角色。在 Cloud Console 中,您還可以建立和管理自訂角色,以及授予服務帳號對專案的存取權限。
請注意,在 Google Cloud Console 中,專案成員稱為主體。
如果您專案的擁有者無法再執行所有者的任務(例如,該人員離開了您的公司),並且您的專案不是透過 Google Cloud 組織管理的(請參閱下一段),您可以聯絡 Firebase 支援團隊指定的臨時所有者。
請注意,如果 Firebase 專案屬於 Google Cloud 組織,則它可能沒有所有者。如果您無法找到 Firebase 專案的擁有者,請聯絡管理您的 Google Cloud 組織的人員來為該專案指派所有者。
如何找到 Firebase 專案的所有者?
您可以在以下位置查看項目成員及其角色:
- 如果您有權在 Firebase 控制台中存取該項目,則可以在 Firebase 控制台的使用者和權限頁面中查看項目成員列表,包括所有者。
- 如果您無法存取 Firebase 控制台中的項目,請檢查您是否有權存取 Google Cloud Console 中的項目。您可以在 Google Cloud Console 的IAM頁面中查看專案成員列表,包括所有者。
如果您專案的擁有者無法再執行所有者的任務(例如,該人員離開了您的公司),並且您的專案不是透過 Google Cloud 組織管理的(請參閱下一段),您可以聯絡 Firebase 支援團隊指定的臨時所有者。
請注意,如果 Firebase 專案屬於 Google Cloud 組織,則它可能沒有所有者。相反,管理您的 Google Cloud 組織的人員可以執行所有者可以執行的許多任務。但是,要執行多項特定於所有者的任務(例如指派角色或管理 Google Analytics(分析)屬性),管理員可能需要為自己指派實際的擁有者角色來執行這些任務。如果您無法找到 Firebase 專案的擁有者,請聯絡管理您的 Google Cloud 組織的人員來為該專案指派所有者。
為什麼或何時應該為專案成員指派所有者角色?
為了確保 Firebase 專案的正確管理,它必須有一個Owner 。專案擁有者是可以執行多項重要管理作業(例如指派角色和管理 Google Analytics 屬性)的人,Firebase 支援只能滿足經過證明的專案擁有者的管理請求。
為 Firebase 專案設定所有者後,保持這些分配最新非常重要。
請注意,如果 Firebase 專案是 Google Cloud 組織的一部分,則管理您的 Google Cloud 組織的人員可以執行所有者可以執行的許多任務。但是,對於多項特定於所有者的任務(例如指派角色或管理 Google Analytics(分析)屬性),管理員可能需要為自己指派實際的擁有者角色才能執行這些任務。
我不認為我有 Firebase 項目,但我收到了一封有關該項目的電子郵件。我如何訪問這個項目?
您收到的電子郵件應包含用於開啟 Firebase 專案的連結。點擊電子郵件中的連結應在 Firebase 控制台中開啟該項目。
如果您無法開啟連結中的項目,請確保您使用收到有關該項目的電子郵件的相同 Google 帳戶登入 Firebase。您可以透過控制台右上角的帳戶頭像登入和登出 Firebase 控制台。
請注意,如果您是 Google Cloud 組織的管理員,您可能會收到有關組織內部 Firebase 專案發生變更的通知。但是,您可能沒有足夠的權限來開啟 Firebase 專案。在這些情況下,最簡單的解決方案是為自己指派實際的擁有者角色以開啟專案並執行所需的操作。詳細了解分配所有者角色的原因和時間。
平台和框架
請造訪特定於平台的故障排除和常見問題解答頁面,以取得有用的提示和更多常見問題的答案。
Firebase 控制台
支援哪些瀏覽器來存取 Firebase 控制台?
可以從最新版本的熱門桌面瀏覽器(例如 Chrome、Firefox、Safari 和 Edge)存取 Firebase 控制台。目前不完全支援行動瀏覽器。
我可以載入 Firebase 控制台,但為什麼找不到或存取我的 Firebase 專案?
如果您遇到以下任一問題,則此常見問題解答適用:
- Firebase 控制台會傳回錯誤頁面,指出您的專案可能不存在或您無法存取專案。
- 即使您在控制台的搜尋欄位中輸入項目 ID 或項目名稱,Firebase 控制台也不會顯示您的項目。
試試以下故障排除步驟:
- 首先,嘗試直接存取項目的 URL 來存取您的專案。使用以下格式:
https://console.firebase.google.com/project/ PROJECT-ID /overview
- 如果您仍然無法存取該項目或收到權限錯誤,請檢查以下內容:
- 確保您使用有權存取專案的相同 Google 帳戶登入 Firebase。您可以透過控制台右上角的帳戶頭像登入和登出 Firebase 控制台。
- 確保為該專案啟用了 Firebase Management API 。
- 確保為您指派了基本 IAM 角色(擁有者、編輯者、檢視者)之一或具有 Firebase 相關權限的角色,例如Firebase 預定義角色。您可以在 Google Cloud Console 的IAM頁面中查看您的角色。
- 如果您的專案屬於 Google Cloud 組織,您可能需要額外的權限才能查看 Firebase 控制台中列出的項目。請聯絡您的 Google Cloud 組織的管理人員,為您授予查看專案的適當角色,例如瀏覽器角色。
如果上述故障排除步驟均無法讓您找到或存取您的項目,請聯絡Firebase 支援。
為什麼 Firebase 控制台沒有為我加載?
如果您遇到以下任何問題,則此常見問題解答適用:
- Firebase 控制台中的頁面永遠不會完成載入。
- 頁面內的資料未如預期載入。
- 載入 Firebase 控制台時您會收到瀏覽器錯誤訊息。
試試以下故障排除步驟:
- 檢查Firebase 狀態儀表板的控制台行是否有任何可能的服務中斷。
- 確保您使用的是受支援的瀏覽器。
- 嘗試在隱身或私人視窗中載入 Firebase 控制台。
- 停用所有瀏覽器擴充功能。
- 驗證網路連線未被廣告攔截器、防毒軟體、代理商、防火牆或其他軟體封鎖。
- 嘗試使用不同的網路或裝置載入 Firebase 控制台。
- 如果使用 Chrome,請檢查開發人員工具控制台是否有任何錯誤。
如果上述故障排除步驟均無法解決問題,請聯絡Firebase 支援。
我的 Firebase 控制台語言是如何決定的?
Firebase 控制台的語言設定是根據您在Google 帳戶設定中選擇的語言。
若要變更您的語言首選項,請參閱更改語言。
Firebase 控制台支援以下語言:
- 英語
- 巴西葡萄牙語
- 法語
- 德文
- 印尼
- 日本人
- 韓國人
- 俄文
- 簡體中文
- 西班牙語
- 繁體中文
Firebase 控制台支援哪些角色和權限?
Firebase 控制台和 Google Cloud Console 使用相同的底層角色和權限。在Firebase IAM 文件中了解有關角色和權限的更多資訊。
Firebase 支援 Owner、Editor 和 Viewer 等基本(基本)角色:
- 專案擁有者可以為專案新增其他成員、設定整合(專案連結到 BigQuery 或 Slack 等服務),並擁有專案的完全編輯權限。
- 專案編輯者擁有專案的完全編輯權限。
- 項目查看者僅具有項目的讀取存取權限。請注意,Firebase 控制台目前不會隱藏/停用專案檢視者的編輯 UI 控件,但對於指派了檢視者角色的專案成員,這些操作將會失敗。
Firebase 也支援:
- Firebase 預定義角色- 精心策劃的 Firebase 特定角色,可實現比所有者、編輯者和檢視者等基本角色更精細的存取控制。
- 自訂角色— 您建立的完全自訂的 IAM 角色,用於自訂一組符合組織特定要求的權限。
價錢
哪些產品是付費的?哪些是免費的?
Firebase 的付費基礎設施產品包括即時資料庫、Firebase 雲端儲存、雲端功能、託管、測試實驗室和電話身份驗證。我們為所有這些功能提供免費套餐。
Firebase 還擁有許多免費產品:分析、雲端訊息傳遞、通知編輯器、遠端設定、應用程式索引、動態連結和崩潰報告。您可以在所有計劃中無限量地使用這些產品,包括我們的免費 Spark 計劃。此外,除電話身份驗證之外的所有身份驗證功能都是免費的。
Firebase 是否為付費產品提供免費試用積分?
Firebase 付費服務可在Google Cloud 免費試用下使用。新的 Google Cloud 和 Firebase 用戶可以享受 90 天的試用期,其中包括 300 美元的免費 Cloud Billing 積分,以探索和評估 Google Cloud 和 Firebase 產品和服務。
在 Google Cloud 免費試用期內,您將獲得一個免費試用 Cloud Billing 帳戶。在免費試用期內,任何使用該結算帳戶的 Firebase 項目都將包含在 Blaze 定價方案中。
不用擔心,設定此免費試用 Cloud Billing 帳戶不會讓我們向您收費。除非您透過將免費試用 Cloud Billing 帳戶升級為付費帳戶來明確啟用計費,否則不會向您收取費用。您可以在試用期間隨時升級到付費帳戶。升級後,您仍然可以使用任何剩餘積分(90 天內)。
免費試用期結束後,您需要將專案降級為 Spark 定價計劃,或在 Firebase 控制台中設定 Blaze 定價計劃才能繼續使用您的 Firebase 專案。
詳細了解Google Cloud 免費試用。
我如何知道哪個定價方案適合我?
火花定價計劃
我們的 Spark 計劃是免費開發應用程式的好地方。您可以獲得所有免費的 Firebase 功能(Analytics、通知編輯器、Crashlytics 等)以及大量付費基礎設施功能。但是,如果您在一個日曆月內超出了 Spark 計劃資源,您的應用程式將在該月的剩餘時間內關閉。此外,使用 Spark 套餐時,Google Cloud 功能不可用。
火焰定價計劃
我們的 Blaze 計劃專為生產應用程式而設計。 Blaze 計劃還允許您使用付費 Google Cloud 功能擴展您的應用程式。您只需為消耗的資源付費,從而可以根據需求進行擴展。我們努力使我們的 Blaze 計劃價格與行業領先的雲端供應商相比具有競爭力。
如何監控我的使用情況和帳單?
您可以在以下任意儀表板上的 Firebase 控制台中追蹤專案資源的使用情況:
Flame 定價計畫發生了什麼事?
2020 年 1 月,Flame 定價方案(額外配額 25 美元/月)作為新註冊選項的選項被取消。現有計劃用戶獲得了一段寬限期,可以將其項目從 Flame 計劃中遷移出來。 2022 年 2 月,Flame 定價計畫的其餘項目降級為 Spark 定價計畫。
因此,
- 現有的 Spark 和 Blaze 方案項目以及任何新項目都不能再切換到或註冊 Flame 方案。
- 如果您將現有 Flame 計劃項目移至不同的定價計劃,則該項目無法返回 Flame 計劃。
- 降級為Spark套餐的項目可以升級為Blaze套餐,恢復額外的付費服務。
- 對 Flame 計劃的引用已從文件中刪除。
您對 Flame 計劃退休還有更多疑問嗎?請閱讀下面的一些其他常見問題。
想要了解 Firebase 提供的其他定價方案?請造訪我們的Firebase 定價頁面!如果您想開始將任何現有專案轉移到另一個定價計劃,您可以在專案的Firebase 控制台中執行此操作。
有關 Flame 計劃退休的其他常見問題解答
我有一個依賴固定 Firebase 成本的專案、流程或業務模型。我該怎麼辦?
註冊 Blaze 定價計劃,並確保設定預算提醒。
我可以獲得創建新火焰計劃專案的特殊權限嗎?
不,Firebase 不為專案提供切換到或註冊 Flame 方案的特殊存取權限。
我將 Flame 計劃項目更改為不同的定價計劃。我怎樣才能把它改回來?
不再可能切換到 Flame 方案。要存取 Flame 計劃提供的服務,請確保您使用的是 Blaze 定價計劃,並考慮為您的專案設定預算警報。
作為 Flame 計劃停用的一部分,我的專案會自動切換到不同的定價方案。我該怎麼辦?
如果您的專案需要超出 Spark 方案提供的額外配額,您需要將專案升級到 Blaze 定價方案。
為什麼 Flame 打算退役?
多年來,我們看到 Flame 計劃的使用量不斷下降,並且大多數使用該計劃的項目都沒有消耗其全部價值。維持此定價計劃通常不具有成本效益,我們認為,如果資源用於其他 Firebase 計劃,我們可以更好地為每個人服務。
Blaze 計劃中的免費使用與 Spark 計劃中的免費使用有何不同?
Blaze 計劃的免費使用量每天計算。 Cloud Functions、電話驗證和測試實驗室的使用限制也與 Spark 計畫不同。
對於 Cloud Functions,Blaze 計劃的免費使用量是在 Cloud Billing 帳戶層級而不是專案層級計算的,並且具有以下限制:
- 每月 200 萬次調用
- 400K GB 秒/月
- 200K CPU 秒/月
- 每月 5 GB 網路出站流量
對於電話身份驗證,Blaze 計劃的免費使用量按月計算。
對於測試實驗室,免費使用 Blaze 計劃有以下限制:
- 每天 30 分鐘實體設備
- 60 虛擬設備分鐘/天
當我從 Spark 更改為 Blaze 計劃時,免費使用配額是否會重置?
Spark 計劃的免費使用包含在 Blaze 計劃中。轉移到 Blaze 計劃時,免費使用不會重置。
什麼是「同時資料庫連線」?
同時連接相當於一台行動裝置、瀏覽器標籤或連接到資料庫的伺服器應用程式。 Firebase 對應用資料庫的同時連線數量施加嚴格限制。這些限制是為了保護 Firebase 和我們的用戶免受濫用。
Spark 計劃限制為 100,且無法改善。 Flame 和 Blaze 計畫的每個資料庫的並發連線數限制為 200,000 個。
此限制與應用程式的用戶總數不同,因為您的用戶不會同時連接。如果您需要超過 200,000 個並發連接,請閱讀使用多個資料庫進行擴充。
如果我超出即時資料庫的 Spark 計劃儲存或下載限制,會發生什麼事?
為了向您提供可預測的價格,Spark 計劃中可供您使用的資源受到限制。這意味著,當您在任何月份超出任何計劃限制時,您的應用程式將關閉,以防止進一步使用資源和產生額外費用。
如果我超出即時資料庫的 Spark 計劃同時連線限制,會發生什麼事?
當您的應用程式達到 Spark 計劃的並發限制時,任何後續連線都會被拒絕,直到某些現有連線關閉。該應用程式將繼續為已連接的用戶運行。
Firebase 與 Google Cloud 的整合如何運作?
Firebase 與Google Cloud深度整合。專案在 Firebase 和 Google Cloud 之間共享,因此專案可以啟用 Firebase 服務和 Google Cloud 服務。您可以從 Firebase 控制台或 Google Cloud Console 存取相同專案。具體來說:
- 某些 Firebase 產品直接由 Google Cloud 支持,例如 Cloud Storage for Firebase。隨著時間的推移,Google Cloud 支援的產品清單將繼續成長。
- 您的許多設定(包括協作者和結算資訊)均由 Firebase 和 Google Cloud 共用。您對 Firebase 和 Google Cloud 的使用情況會顯示在同一份帳單上。
此外,當您升級至 Blaze 套餐時,您可以直接在 Firebase 專案中使用 Google Cloud 任何世界一流的基礎架構即服務和 API,並以標準Google Cloud 定價。您也可以將資料從 Google Cloud 直接匯出到 BigQuery 進行分析。要了解更多信息,請參閱將 BigQuery 與 Firebase 關聯。
將 Google Cloud 與 Firebase 結合使用(與其他不在同一地點的雲端服務相比)可以帶來許多增強安全性、改善延遲和節省時間的好處。請造訪Google Cloud 網站以了解更多詳細資訊。
如果我在 Google Cloud Console 中新增或刪除該專案的結算帳號,我的 Firebase 專案會發生什麼情況?
如果將 Cloud Billing 帳號新增至 Google Cloud Console 中的項目,且該項目目前位於 Spark 套餐中,則該項目將自動升級至 Firebase Blaze 套餐。
相較之下,如果從 Google Cloud Console 中的專案中刪除現有的活躍 Cloud Billing 帳號,則該專案將降級為 Firebase Spark 計劃。
我可以隨時升級、降級或取消嗎?
是的,您可以隨時升級、降級或取消。請注意,我們不會針對降級或取消提供按比例退款。這意味著,如果您在計費週期結束之前降級或取消,您仍需支付當月剩餘時間的費用。
我將獲得什麼樣的支持?
所有 Firebase 應用程式(包括使用免費方案的應用程式)都會在美國太平洋地區工作時間內獲得 Firebase 工作人員的電子郵件支援。所有帳戶都對計費相關問題、帳戶相關問題、技術(故障排除)問題和事件報告提供無限支援。
我可以限制 Blaze 計劃的使用量嗎?
不可以,您目前無法限制 Blaze 計劃的使用量。我們正在評估支持 Blaze 計劃使用上限的選項。
Blaze 用戶可以為其項目或帳戶定義預算,並在支出接近這些限制時收到警報。了解如何設定預算提醒。
什麼是自動備份?你們提供每小時備份嗎?
自動備份是 Blaze 定價方案中為客戶提供的進階功能,每天備份一次 Firebase 即時資料庫資料並將其上傳到Google Cloud Storage 。
我們不提供每小時備份。
你們提供開源、非營利或教育折扣嗎?
我們的 Spark 計劃可供任何類型的個人或組織使用,包括非營利組織、學校和開源專案。由於這些計劃已經包含慷慨的配額,因此我們不會為開源、非營利或教育專案提供任何特殊折扣或計劃。
您是否提供企業合同,定價,支援或專用基礎設施託管?
我們的Blaze計畫適合各種規模的企業,我們的SLA符合或超過雲端基礎架構的業界標準。但是,我們目前不提供企業合同,定價或支持,也沒有為我們的即時資料庫等服務提供專用的基礎架構託管(即本地安裝)。我們正在努力添加其中一些功能。
您提供臨時定價嗎?我只想付費一兩個功能。
我們在Blaze計劃中提供臨時定價,您只為使用的功能付費。
付費的燃燒計畫如何與廣告合作?有沒有付費方案的沒有成本的廣告學分?
Firebase定價方案與廣告分開,因此沒有成本的廣告信用額。作為Firebase開發人員,您可以將廣告帳戶「連結」到Firebase以支援轉換追蹤。
所有廣告活動都直接在廣告中管理,廣告計費由廣告控制台管理。
雲端功能定價
為什麼我需要一個計費帳戶才能將雲端功能用於firebase?
Firebase的雲端功能仰賴一些付費的Google服務。使用Firebase CLI 11.2.0及更高的新功能部署依賴雲端建置和人工製品註冊表。舊版的部署以相同的方式使用雲端構建,但要依靠容器註冊表和雲端儲存進行儲存而不是文物註冊表。除了現有定價外,還將對這些服務的使用進行計費。
Firebase CLI 11.2.0和更新版本的儲存空間
人工製品註冊表提供了運作功能的容器。 Artifact註冊表免費提供前500MB,因此您的第一個功能部署可能不會產生任何費用。高於該閾值,每增加一個GB的儲存費用為每月0.10美元。
Firebase CLI 11.1.x和先前版本的儲存空間
對於部署到較舊版本的功能,容器註冊表提供了運行功能的容器。您將為部署功能所需的每個容器收費。您可能會注意到儲存的每個容器的費用很小,例如,1GB的儲存費用為每月0.026美元。
要了解有關您的帳單可能如何變化的更多信息,請查看以下內容
雲端功能的功能是否仍具有無成本用法?
是的。在Blaze計畫中,雲端功能為調音,運算時間和Internet流量提供了無罪等級。每月免費提供前2,000,000個調用,400,000 GB-SEC,200,000 CPU-SEC和5 GB的Internet出口流量。您只會以高於這些閾值的使用而收取費用。
在第一個500MB的無成本儲存空間之後,每個部署作業都會為該功能容器所使用的儲存空間產生小規模的費用。如果您的開發流程取決於部署用於測試的功能,則可以透過在開發過程中使用Firebase Local Emulator Suite進一步最小化成本。
請參閱Firebase定價方案和雲端功能定價範例場景。
Firebase計畫提高Firebase雲端功能的配額和限制嗎?
否。除了刪除最大建置時間限制外,沒有計劃更改配額的計劃;在達到120分鐘的每日建造配額時,沒有收到錯誤或警告,您將根據Blaze定價方案的條款進行費用。請參閱配額和限制。
我可以獲得Google Cloud $ 300信用嗎?
是的,您可以在Google Cloud Console中建立一個雲端計費帳戶,以取得300美元的信用,然後將該雲端計費帳戶連結到Firebase專案。
有關Google Cloud信用的更多資訊。
請注意,如果執行此操作,則必須在Firebase控制台中設定Blaze定價計劃,以便您的專案在耗盡300美元的信用額後繼續工作。
我想遵循一個Codelab來了解Firebase。您能給我一個臨時的計費帳戶嗎?
不,抱歉。您可以使用Firebase模擬器進行開發,而無需擁有雲端計費帳戶。另外,試試申請Google Cloud Free Itial 。如果您因此變更而付清帳單時仍遇到麻煩,請聯絡Firebase支援。
我擔心我會籌集一張巨額帳單。
您可以在Google Cloud Console中設定預算警報,以協助控製成本。此外,您可以對每個功能建立的計費實例數量設定限制。若要了解典型場景成本的想法,請參閱雲端功能定價範例。
我如何檢查我目前的計費費用?
查看Firebase控制台中的用法和計費儀表板。
我使用Firebase擴充。我需要一個計費帳戶嗎?
是的。由於擴展使用雲功能,因此擴展將受到與其他功能相同的電荷。
要使用擴展,您需要升級到Blaze定價方案。除了您使用Firebase Services相關的任何費用外,您還會收取少量金額(通常每月為每月0.01美元(即使不使用它們)所需的燃箱資源(即使不使用)。
Firebase定價的雲端存儲
我如何預測上傳和下載操作的費用將是多少?
造訪Firebase定價頁面,並使用Blaze Plan計算器。此計算器列出了用於Firebase的雲端儲存的所有使用類型。
使用滑桿輸入預期的儲存儲存桶。計算器將估算您的每月帳單。
如果我超越了火花計劃上傳,下載或儲存限制,以用於Firebase的雲端儲存?
當您超過火花計劃專案中雲端儲存的限制時,結果取決於您超過的限制類型:
- 如果您超過了GB存儲的限制,則除非刪除存儲或升級的一些數據,否則您將無法存儲任何數據,除非您刪除提供更多存儲空間或無限存儲空間的計劃。
- 如果您超過了GB下載的限制,則您的應用程式將無法下載更多數據,直到第二天(從午夜開始,美國太平洋時間開始),除非您升級到限制性較小的計劃或沒有限制的計劃。
- 如果您超出了上傳或下載操作限制,則您的應用程式將無法上傳或下載更多數據,直到第二天(從午夜開始,美國太平洋時間開始),除非您升級到限制性較小的計劃,否則限制。
隱私
我可以在哪裡找到有關火箱中隱私和安全性的資訊?
Firebase SDK是否在分析之外記錄任何用法/診斷資訊?
是的。目前是僅iOS的,但將來可能會發生變化。 Firebase Apple Platforms SDK預設包含FirebaseCoreDiagnostics
框架。 Firebase使用此框架來收集SDK使用率和診斷信息,以幫助確定未來產品增強功能。 FirebaseCoreDiagnostics
是可選的,因此,如果您想選擇退出firebase診斷日誌,則可以透過從應用程式連結程式庫來做到這一點。您可以在github上瀏覽全部來源,包括已記錄值
A/B 測試
A/B測試:我可以創建和執行多少個實驗?
每個專案最多可允許您進行300個實驗,其中最多可由24個運行實驗組成,其餘的則作為草稿或完成。
A/B測試:為什麼在將我的專案重新連結到Google Analytics(分析)之後,我為什麼不能查看我的實驗?
連結到其他Google Analytics(分析屬性)將使您失去事先建立的實驗的存取權。為了重新獲得對先前實驗的訪問,請將您的專案重新連結到建立實驗時連結的Google Analytics(分析)屬性。
A/B測試:在建立遠端設定實驗時,為什麼我會收到「未連結到Google Analytics(分析)訊息的專案?
如果您已經連結了Firebase和Google Analytics(但仍可看到Google Analytics(分析)連結的訊息,請確保您專案中所有應用程式都存在分析流。目前,專案中的所有應用程式都必須連接到Google Analytics(分析)流以使用A/B測試。
您可以在Firebase控制台內的Google Analytics(分析整合詳細資訊頁面)上找到所有活動流程的列表,從settings項目設定chevron_right INTEMENTIONS chevron_right GOOGLE ANALYTICS chevron_right MANAGE存取。
為任何沒有一個應用程式的應用程式建立Google Analytics(分析)流都應該解決該問題。有幾種方法可以為缺少應用程式建立流:
- 如果您只有一個或兩個應用程式缺少關聯的Google Analytics(分析流),則可以選擇以下方法之一來新增Google Analytics(分析)流:
- 在Firebase控制台中刪除並重新新增沒有活動流的任何應用程式。
- 從Google Analytics(Analyticsiss Console)中,選擇Admin ,按一下資料流,然後按一下「新增串流」 ,新增遺失的應用程式的詳細信息,然後按一下註冊應用程式。
- 如果您有多個遺失的應用程式流,請連結和重新連結Google Analytics(分析屬性)是建立缺少的應用程式流的最快,最有效的方法:
- 從settings項目設定中,選擇整合。
- 在Google Analytics(分析卡)中,按一下管理以存取Firebase和Google Analytics(分析)設定。
- 記下Google Analytics(分析屬性ID)和連結的Google Analytics(分析)帳戶。
- 按一下more_vert ,然後從此專案中選擇Unlink Analytics 。
- 查看出現的警告(在這裡不用擔心;您將在下一步中重新連結相同的屬性),然後按一下Unlink Google Analytics(分析) 。
連續連結完成後,您將被重定向到整合頁面。 - 在Google Analytics (分析卡)中,按一下啟用可以開始重新連結程序。
- 從選擇帳戶清單中選擇您的分析帳戶。
- 在此帳戶中自動建立新屬性的旁邊,按一下edit Edit」 ,然後從出現的分析屬性清單中,選擇您的屬性ID。
出現項目中所有應用程式的清單。列出了每個應用程式的現有流映射,沒有流的應用程式將為它們創建。 - 按一下啟用Google Analytics(分析)以重新連結該屬性。
- 點選完成。
如果您仍然收到錯誤在執行這些步驟後使用遠端設定建立A/B測試,請聯絡Firebase支援。
AdMob
ADMOB:我可以將Windows應用程式連結到Firebase嗎?
不,目前不支援Windows應用程式。
Admob:為什麼我不能將我的應用程式與Firebase控制台的Admob連結起來?
您可以透過ADMOB控制台將ADMOB應用程式連結到Firebase應用程式。學習如何。
ADMOB:我需要將Firebase應用程式連結到ADMOB應用程式的權限或存取權限?
為了進行此鏈接,您需要以下訪問:
- ADMOB :您需要成為ADMOB管理員。
- firebase :您必須擁有
firebase.links.create
許可,其中包含在所有者角色和firebase管理員角色中。 - Google Analytics(分析) :您必須具有與Firebase專案相關的屬性的編輯角色或管理使用者角色。了解更多。
ADMOB:同一ADMOB帳戶中的多個使用者可以使用ADMOB應用程式和Firebase應用程式嗎?
對於多用戶ADMOB帳戶,建立第一個Firebase連結並接受Firebase服務條款的使用者是唯一可以在ADMOB應用程式和Firebase應用程式之間建立新連結的使用者。
ADMOB:要使用ADMOB,我應該使用Firebase SDK進行ADMOB還是Google Mobile Ads SDK?
- 對於iOS項目,請使用Google Mobile Ads SDK:
pod 'Google-Mobile-Ads-SDK'
- 對於Android項目,請使用Google Mobile Ads SDK:
implementation 'com.google.android.gms:play-services-ads:22.5.0'
請注意,用於ADMOB的Firebase Android SDK包括用於Google Analytics(分析)的Firebase SDK。因此,如果您的應用程式呼叫任何Google Analytics(分析)API,並且您切換到使用Google Mobile Ads SDK,請確保您明確添加Firebase SDK的依賴性Google Analytics(
)com.google.firebase:firebase-analytics build.gradle
檔。 - 對於C ++項目和Unity項目,請按照各自的文件中的說明進行操作。
分析
分析:為什麼Google Analytics(Analytics)使用Firebase產品的建議部分?
Google Analytics(分析)是一種免費且無限的分析解決方案,可與Firebase功能一起使用以提供強大的見解。它使您可以在crashlytics,FCM中的通知效果,動態連結的深層連結效能以及從Google Play的應用程式內購買資料中查看事件日誌。它可以為遠端配置,遠端配置個人化等高級受眾定位提供動力。
Google Analytics(分析)在Firebase控制台中充當智慧層,可為您提供有關如何開發高品質應用程序,成長用戶群並賺更多錢的更可行的見解。
要開始,請閱讀文件。
分析:我如何控制我的分析數據如何與其他燃料共享?
預設情況下,您的Google Analytics(分析資料)用於增強其他Firebase和Google功能。您可以隨時在專案設定中控制Google Analytics(分析資料)。了解有關數據共享設定的更多資訊。
分析:如何更新分析屬性設定?
在您的Google Analytics(Analyticsis)屬性中的管理頁面中,您可以更新您的屬性設置,例如:
- 數據共享設定
- 資料保留設定
- 時區和貨幣設置
若要更新您的屬性設置,請執行下列步驟:
我的iOS應用程式中的分析:我可以在沒有AD歸因和IDFA集合功能的情況下安裝分析嗎?
是的。有關更多詳細信息,請參見配置資料收集和使用頁面。
分析:與2021年10月更新有關的Google Analytics(分析)部分中發生了什麼變化?
您可以在Firebase說明中心文章中找到這些變更的摘要,新的Google Analytics(Google Analytics)4在Firebase的Google Analytics(分析)中。
分析:為什麼在從Google Analytics(分析)中連結Firebase後,為什麼不在Firebase控制台中看到任何分析資料?
分析資料位於Google Analytics(分析)屬性中 - 不在Firebase專案中。如果您刪除或UNINK屬性,則Firebase將無法存取分析數據,並且您會在Firebase控制台中看到一個空的分析儀表板。請注意,由於資料仍然存在於先前連結的屬性中,因此您始終可以將屬性重新連結到Firebase,並在Firebase控制台中查看分析資料。
將全新的Google Analytics(以及新的Google Analytics(分析''屬性)連結到您的Firebase項目,將導致Firebase控制台中的空分析儀表板。但是,如果您先前連結的屬性仍然存在,則可以將現有資料從舊屬性移至新屬性。
分析:如果我的分析屬性及其資料被刪除,是否有任何方法可以將它們恢復?
否。如果您的屬性已被刪除,則不可能取消刪除該屬性或檢索該屬性中儲存的先前收集的分析資料。
如果您想再次開始使用Google Analytics(分析),則可以將新屬性或現有屬性連結到Firebase專案。您可以在Firebase控制台或Google Analytics(分析)UI中進行此連結。了解有關將Google Analytics(分析)屬性連結到Firebase專案的更多資訊。
分析:如果我的分析屬性已刪除,我可以將新的Google Analytics(分析)屬性連結到我的Firebase專案並再次開始使用分析嗎?
如果您想再次開始使用Google Analytics(分析),則可以將新屬性或現有屬性連結到Firebase專案。您可以在Firebase控制台或Google Analytics(分析)UI中進行此連結。了解有關將Google Analytics(分析)屬性連結到Firebase專案的更多資訊。
請注意,由於所有分析資料都儲存在該屬性中(不是Firebase專案),因此無法檢索先前收集的分析資料。
分析: Firebase產品或整合的Google產品將如何受我的分析屬性刪除的影響?
幾種Firebase產品依賴Google Analytics(分析)整合。如果您的分析屬性及其資料被刪除,則使用下列產品,將發生以下情況:
- Crashlytics - 您無法再看到無碰撞用戶,麵包屑日誌和/或速度警報。
- 雲端訊息傳遞和應用程式內訊息傳遞 - 您無法再使用定位,廣告活動指標,受眾細分和分析標籤。
- 遠端配置 - 您無法再使用目標配置或個人化。
- A/B測試 - 由於Google Analytics(分析)提供了實驗測量,因此您無法再使用A/B測試。
- 動態連結 - 任何依賴Google Analytics(分析)資料的功能都會中斷。
此外,以下整合將受到影響:
- 您不能再將分析資料匯出到BigQuery 。
- 您無法再利用Google Ads整合或Google Admob整合。
分析:如何分割未符合某些標準的使用者?
您可以透過「負針對」這些使用者來重新構架問題。例如,將問題重新架構為“不要向購買某些東西的人展示廣告”,並構成這些用戶的受眾。
分析: Google Analytics(分析)介面中定義的受眾和/或事件是否也在Firebase控制台中可用?
您的受眾和用戶屬性將同步。對於某些功能,您需要使用Google Analytics(分析)接口,例如分割和封閉的漏斗。您可以透過Firebase控制台直接存取Google Analytics(分析)介面。
您從Firebase控制台進行的任何變更也可以在Google Analytics(分析)中執行,這些變更將反映在Firebase中。
驗證
Firebase身份驗證:哪些國家 /地區支援電話身份驗證?
Firebase身份驗證支援世界範圍內的電話號碼驗證,但並非所有網路可靠地傳遞我們的驗證訊息。以下國家的交付率良好,應該預期電話號碼登入良好。
國家 | 程式碼 |
---|---|
廣告 | 安道爾 |
AE | 阿拉伯聯合大公國 |
AF | 阿富汗 |
股份公司 | 安地卡及巴布達 |
AL | 阿爾巴尼亞 |
是 | 亞美尼亞 |
AO | 安哥拉 |
擴增實境 | 阿根廷 |
作為 | 美屬薩摩亞 |
在 | 奧地利 |
非盟 | 澳洲 |
愛華 | 阿魯巴島 |
AZ | 亞塞拜然 |
學士 | 波士尼亞與赫塞哥維納 |
BB | 巴貝多 |
BD | 孟加拉 |
是 | 比利時 |
BF | 布吉納法索 |
BG | 保加利亞 |
北京 | 貝南 |
BM | 百慕達 |
BN | 汶萊達魯薩蘭國 |
博 | 玻利維亞 |
BR | 巴西 |
學士 | 巴哈馬 |
BT | 不丹 |
體重 | 波札那 |
經過 | 白俄羅斯 |
苯札 | 貝里斯 |
CA | 加拿大 |
光碟 | 剛果(金沙薩) |
CF | 中非共和國 |
CG | 剛果(布拉柴維爾) |
CH | 瑞士 |
CI | 科特迪瓦 |
CK | 庫克群島 |
化學發光 | 智利 |
公分 | 喀麥隆 |
一氧化碳 | 哥倫比亞 |
CR | 哥斯大黎加 |
履歷 | 維德角 |
連續波 | 庫拉索 |
CY | 賽普勒斯 |
捷克 | 捷克共和國 |
德 | 德國 |
DJ | 吉布地 |
德克 | 丹麥 |
DM | 多明尼加 |
做 | 多明尼加共和國 |
東正 | 阿爾及利亞 |
歐共體 | 厄瓜多 |
例如 | 埃及 |
ES | 西班牙 |
ET | 衣索比亞 |
FI | 芬蘭 |
縮寫詞 | 斐濟 |
氟肯 | 福克蘭群島(馬爾維納斯) |
調頻 | 密克羅尼西亞聯邦 |
FO | 法羅群島 |
FR | 法國 |
遺傳演算法 | 加彭 |
國標 | 英國 |
GD | 格瑞那達 |
通用電氣 | 喬治亞州 |
GF | 法屬圭亞那 |
GG | 根西島 |
生長激素 | 迦納 |
胃腸道 | 直布羅陀 |
GL | 格陵蘭 |
通用汽車 | 甘比亞 |
全科醫生 | 瓜德羅普島 |
格Q | 赤道幾內亞 |
GR | 希臘 |
GT | 瓜地馬拉 |
Gy | 蓋亞那 |
香港 | 中國香港特別行政區 |
霍尼韋爾 | 宏都拉斯 |
人力資源 | 克羅埃西亞 |
H T | 海地 |
胡 | 匈牙利 |
ID | 印尼 |
IE | 愛爾蘭 |
伊爾 | 以色列 |
我是 | 馬恩島 |
在 | 印度 |
智商 | 伊拉克 |
它 | 義大利 |
乙腦 | 球衣 |
傑明 | 牙買加 |
喬 | 約旦 |
J.P | 日本 |
凱 | 肯亞 |
公斤 | 吉爾吉斯斯坦 |
科赫 | 柬埔寨 |
知識管理 | 葛摩 |
KN | 聖克里斯多福及尼維斯 |
韓國 | 韓國(南) |
千瓦 | 科威特 |
肯塔基州 | 開曼群島 |
克孜 | 哈薩克 |
洛杉磯 | 寮國人民民主共和國 |
磅 | 黎巴嫩 |
液相層析 | 聖露西亞 |
李 | 列支敦斯登 |
力康 | 斯里蘭卡 |
LS | 賴索托 |
LT | 立陶宛 |
魯 | 盧森堡 |
左心室 | 拉脫維亞 |
LY | 利比亞 |
嘛 | 摩洛哥 |
醫學博士 | 摩爾多瓦 |
我 | 蒙特內哥羅 |
中頻 | 聖馬丁(法國部分) |
MG | 馬達加斯加 |
MK | 馬其頓共和國 |
毫米 | 緬甸 |
明尼蘇達州 | 蒙古 |
莫 | 中國澳門特別行政區 |
多發性硬化症 | 蒙特塞拉特 |
公噸 | 馬爾他 |
畝 | 模里西斯 |
兆瓦 | 馬拉威 |
MX | 墨西哥 |
我的 | 馬來西亞 |
米茲 | 莫三比克 |
不適用 | 納米比亞 |
數控 | 新喀裡多尼亞 |
東北 | 尼日 |
核因子 | 諾福克島 |
不合格 | 奈及利亞 |
你 | 尼加拉瓜 |
荷蘭 | 荷蘭 |
不 | 挪威 |
NP | 尼泊爾 |
紐西蘭 | 紐西蘭 |
奧姆 | 阿曼 |
PA | 巴拿馬 |
聚乙烯醇 | 秘魯 |
PG | 巴布亞紐幾內亞 |
PH值 | 菲律賓 |
PK | 巴基斯坦 |
PL | 波蘭 |
午安 | 聖皮埃爾和密克隆群島 |
公關 | 波多黎各 |
聚苯乙烯 | 巴勒斯坦領土 |
PT | 葡萄牙 |
平陽 | 巴拉圭 |
品質保證 | 卡達 |
關於 | 團圓 |
逆滲透 | 羅馬尼亞 |
RS | 塞爾維亞 |
魯 | 俄羅斯聯邦 |
RW | 盧安達 |
SA | 沙烏地阿拉伯 |
SC | 塞席爾 |
東南歐 | 瑞典 |
SG | 新加坡 |
SH | 聖赫勒拿島 |
SI | 斯洛維尼亞 |
SK | 斯洛伐克 |
SL | 獅子山 |
序號 | 塞內加爾 |
SR | 蘇利南 |
英石 | 聖多美和普林西比 |
SV | 薩爾瓦多 |
深圳 | 史瓦濟蘭 |
TC | 特克斯和凱科斯群島 |
TG | 多哥 |
TH | 泰國 |
TL | 東帝汶 |
TM值 | 土庫曼 |
到 | 東加 |
TR | 火雞 |
TT | 千里達及托巴哥 |
台灣 | 中華民國台灣 |
泰國茲 | 坦尚尼亞聯合共和國 |
UA | 烏克蘭 |
UG | 烏幹達 |
我們 | 美國 |
UY | 烏拉圭 |
烏茲別克 | 烏茲別克 |
VC | 聖文森及格瑞那丁 |
VE | 委內瑞拉(玻利瓦爾共和國) |
VG | 英屬維京群島 |
六、 | 美國維京群島 |
越南 | 越南 |
WS | 薩摩亞 |
葉 | 葉門 |
油田 | 馬約特島 |
札阿 | 南非 |
ZM | 尚比亞 |
ZW | 辛巴威 |
Firebase身份驗證:使用電話身份驗證時,如何防止SMS濫用?
為了幫助保護您的專案免受SMS流量抽水和API濫用的影響,請採取以下步驟:
考慮設定SMS區域政策
尋找已發送的SMS數量很高的區域和經過驗證的SMS的數字非常低(或零)。驗證/發送的比率是您的成功率。健康的成功率通常在70-85%的範圍內,因為SMS不是保證的交付協議,並且某些地區可能會遭受濫用。低於50%的成功率意味著許多人發送了短信,但很少的成功登入是不良演員和SMS流量抽水的常見指標。
使用SMS區域政策來拒絕成功率較低的SMS地區,或僅在您的應用程式僅用於在某些市場中分發時才允許某些區域。
限制您的授權身分驗證網域
使用身份驗證設定儀表板來管理授權網域。預設將localhost
域新增至核准的驗證網域以簡化開發。考慮從生產項目中的授權網域中刪除localhost
,以防止壞演員在其localhost
上執行程式碼以存取您的生產項目。
啟用並執行應用程式檢查
啟用應用程式檢查,以幫助您的專案免受API濫用,證明要求僅來自與您的專案相關的申請。
若要使用Firebase驗證使用應用程式檢查,您必須使用Identity平台升級至Firebase身份驗證。
請記住,您需要在Firebase控制台中執行應用程式檢查是否驗證(在執行前考慮監視流量)。另外,請仔細檢查您的Recaptcha Enterprise批准的網站列表,以驗證其僅包含您的生產站點,並且在應用程式檢查中註冊到專案的應用程式列表是準確的。
請注意,應用程式檢查透過斷言呼叫來自您的註冊應用程式之一,有助於防止自動攻擊。它不會阻止使用者以意外的方式使用您的應用程式(例如,開始,從未完成登入流程以產生已發送的SMS)。
Firebase身份驗證:在我的Android應用程式中,為什麼我會遇到以下錯誤:
Google sign in failed
?
如果您收到以下錯誤,請依照此常見問題的故障排除步驟:
GoogleFragment: Google sign in failed
com.google.android.gms.common.api.ApiException: 13: Unable to get token.
at
com.google.android.gms.internal.auth-api.zbay.getSignInCredentialFromIntent(com.google.android.gms:play-services-auth@@20.3.0:6)
確保作為身份驗證提供者正確啟用Google登入:
在Firebase控制台中,開啟身份驗證部分。
在「符號」標籤中,停用並重新啟用Google登入方法(即使已經啟用了):
開啟Google登入方法,停用它,然後按一下「儲存」 。
重新開啟Google登入方法,啟用它,然後按一下「儲存」 。
確保您的應用程式使用其最新的Firebase設定檔(
google-services.json
)。
取得您的應用程式的設定檔。檢查您是否仍會遇到錯誤。如果是,請繼續下一個故障排除步驟。
確保存在所需的OAUTH 2.0客戶。
Firebase身份驗證:在我的Apple Platform應用程式中,為什麼我會遇到以下錯誤:
You must specify <clientID> in <GIDConfiguration>
?
如果您收到以下錯誤,請依照此常見問題的故障排除步驟:
You must specify |clientID| in |GIDConfiguration|
確保作為身份驗證提供者正確啟用Google登入:
在Firebase控制台中,開啟身份驗證部分。
在「符號」標籤中,停用並重新啟用Google登入方法(即使已經啟用了):
開啟Google登入方法,停用它,然後按一下「儲存」 。
重新開啟Google登入方法,啟用它,然後按一下「儲存」 。
確保您的應用程式使用其最新的Firebase設定檔(
GoogleService-Info.plist
)。
取得您的應用程式的設定檔。檢查您是否仍會遇到錯誤。如果是,請繼續下一個故障排除步驟。
確保存在所需的OAUTH 2.0客戶。
Firebase身份驗證:在我的網路應用程式中,為什麼我會收到以下錯誤:
AuthErrorCode.INVALID_OAUTH_CLIENT_ID
?
如果您收到以下錯誤,請依照此常見問題的故障排除步驟:
AuthErrorCode.INVALID_OAUTH_CLIENT_ID
確保作為身份驗證提供者正確啟用Google登入:
在Firebase控制台中,開啟身份驗證部分。
在「符號」標籤中,停用並重新啟用Google登入方法(即使已經啟用了):
開啟Google登入方法,停用它,然後按一下「儲存」 。
重新開啟Google登入方法,啟用它,然後按一下「儲存」 。
另外,在「驗證」部分的Google登入提供者設定中,請確保OAUTH客戶端ID和秘密匹配Google Cloud Console的憑證頁面中顯示的Web用戶端(在OAuth 2.0客戶端IDS中查看)。
Firebase身份驗證:如何手動建立OAuth Web客戶端?
開啟Google Cloud Console的憑證頁面。
在頁面頂部,選擇「建立憑證」> OAUTH客戶端ID 。
如果提示您要設定同意畫面,請按照螢幕上的指示進行操作,然後繼續執行此常見問題的以下步驟。
建立OAuth Web客戶端:
對於應用程式類型,選擇Web應用程式。
對於授權的JavaScript起源,請新增以下內容:
-
http://localhost
-
http://localhost:5000
-
https:// PROJECT_ID .firebaseapp.com
-
https:// PROJECT_ID .web.app
-
對於授權的重定向URI ,請新增以下內容:
-
https:// PROJECT_ID .firebaseapp.com/__/auth/handler
-
https:// PROJECT_ID .web.app/__/auth/handler
-
儲存OAuth客戶端。
將新的OAuth客戶端ID和客戶端秘密複製到剪貼簿。
在Firebase控制台中,開啟身份驗證部分。
在「符號」標籤中,開啟Google登入供應商,然後貼上Web Server客戶端ID,然後您剛從Google Cloud Console建構和複製的秘密。按一下「儲存」 。
firebase身份驗證:如何確定為確認電子郵件的電子郵件範本確定的
%APP_NAME%
,當他們使用電子郵件地址和密碼註冊時可以發送給使用者?
在2022年12月之前,電子郵件範本中的%APP_NAME%
填充了OAuth品牌名稱,每當Android應用程式在Firebase專案中註冊時,該品牌都會自動提供。現在,由於僅在啟用Google登入時才能提供OAuth品牌,因此以下描述了%APP_NAME%
的確定:
如果有OAuth品牌名稱可用,則電子郵件範本中的
%APP_NAME%
將為OAuth品牌名稱(與2022年12月前的行為相同)。如果OAuth品牌名稱不可用,則是確定電子郵件範本中
%APP_NAME%
的方式:對於Web應用程序,
%APP_NAME%
將是預設的firebase託管網站名稱(在.firebaseapp.com
和.web.app
之前的值,以及通常的firebase專案ID)。對於行動應用程式:
如果請求中存在Android軟體包名稱或iOS捆綁包ID,則
%APP_NAME%
分別是Play商店或App Store中使用的應用程式名稱。否則,
%APP_NAME%
將是預設的firebase託管網站名稱(在.firebaseapp.com
和.web.app
之前的值,以及通常的firebase專案ID)。
請注意,如果預設firebase託管網站名稱的查找失敗,則最終的後備是將firebase專案ID用作
%APP_NAME%
。
雲端功能
雲端功能運行時支援
如何升級到最新支援的Node.js?
- 確保您正在按照大火定價計劃。
- 確保您使用的是Firebase CLI的最新版本。
- 更新函數
package.json
中的engines
欄位。 - 可選地,使用Firebase Local Emulator Suite測試您的變更。
- 重新部署所有功能。
如何確保將功能部署到特定的node.js執行時間?
在Firebase控制台中,前往功能儀表板,選擇函數,然後在其他詳細資料下檢查函數的語言。
我使用Firebase擴充。我會受到雲端功能運行時更新的影響嗎?
是的。由於擴展名使用雲端功能,因此需要在與雲端功能相同的時間軸上更新擴展名的運行時。
我們建議您定期更新至專案中安裝的每個擴充功能的最新版本。您可以透過Firebase Console或Firebase CLI升級專案的擴充。
雲端訊息傳遞
雲端訊息傳遞:通知作曲家和雲端訊息傳遞有什麼不同?
Firebase Cloud訊息傳遞透過其客戶端SDK,HTTP和XMPP伺服器協定提供了完整的訊息傳遞功能。對於具有更複雜訊息要求要求的部署,FCM是正確的選擇。
通知作曲家是建立在Firebase Cloud Messaging上的輕便,無伺服器的訊息傳遞解決方案。借助用戶友好的圖形控制台並減少了編碼要求,通知作曲家使用戶可以輕鬆發送訊息以重新接觸和保留用戶,促進應用程式成長和支援行銷活動。
能力 | 通知作曲家 | 雲端訊息傳遞 | |
---|---|---|---|
目標 | 單一裝置 | ||
客戶訂閱主題(即天氣) | |||
預定義的用戶段(應用程序,版本,語言)中的客戶端 | |||
指定分析受眾的客戶 | |||
設備組中的客戶 | |||
從客戶端到伺服器上游 | |||
訊息類型 | 通知最多2KB | ||
數據訊息最大為4KB | |||
送貨 | 即時 | ||
未來的客戶設備當地時間 | |||
分析 | 內建通知分析收集和漏斗分析 |
雲端訊息傳遞: Apple宣布他們正在為APN的傳統二進位協議貶低。我需要做些什麼嗎?
否。FirebaseCloud Message在2017年切換到基於HTTP/2的APNS協定。如果您使用FCM將通知發送到iOS設備,則不應採取任何措施。
雲端訊息傳遞:我是否需要使用其他Firebase服務才能使用FCM?
您可以將Firebase Cloud Message用作獨立元件,而無需使用其他Firebase服務,就像使用GCM一樣。
雲端訊息傳遞:我是現有的Google雲端訊息(GCM)開發人員。我應該轉到Firebase雲端訊息傳遞嗎?
FCM是Firebase品牌下的GCM的新版本。它繼承了GCM的核心基礎架構,並具有新的SDK,以使雲端訊息傳遞開發更加容易。
升級到FCM SDK的好處包括:
- 更簡單的客戶開發。您不再需要編寫自己的註冊或訂閱重試邏輯。
- 開箱即用的通知解決方案。您可以使用Web控制台使用Notifications Composer,這是一個無伺服器通知解決方案,該解決方案可讓任何人根據Google Analytics(來自Google Analytics)的洞察力向針對特定受眾的通知發送通知。
雲端訊息傳遞:為什麼我的目標裝置顯然無法接收訊息?
當看起來設備未成功收到訊息時,請先檢查這兩個潛在原因:
通知訊息的前景訊息處理。客戶端應用程式需要新增訊息處理邏輯以處理通知訊息時,當該應用在裝置上的前景中。查看iOS和Android的詳細資訊。
網路防火牆限制。如果您的組織具有限制往返或從Internet的流量的防火牆,則需要配置它以允許與FCM的連接,以便您的Firebase Cloud Messaging Messaging Messaging Client Client應用程式接收訊息。要開啟的連接埠是:
- 5228
- 5229
- 5230
FCM通常使用5228,但有時使用5229和5230。FCM不提供特定的IP,因此您應該允許您的防火牆接受與Google ASN列出的15169年IP區塊中包含的所有IP位址的連線。
雲端訊息傳遞:我已經在我的Android應用程式中實作了onMessageReceived
cepecepecepecepeperecepepecepecepecepepeperece所以並未被呼叫。
當您的應用程式在背景時,將在系統匣中顯示通知訊息,並且未呼叫onMessageReceived
。 For notification messages with a data payload, the notification message is displayed in the system tray, and the data that was included with the notification message can be retrieved from the intent launched when the user taps on the notification.
For more information, see Receive and handle messages .
Notifications composer: What's the difference between the Notifications composer and Cloud Messaging?
The Notifications composer is a lightweight, serverless messaging solution built on Firebase Cloud Messaging. With a user-friendly graphical console and reduced coding requirements, the Notifications composer lets users easily send messages to reengage and retain users, foster app growth, and support marketing campaigns.
Firebase Cloud Messaging provides a complete set of messaging capabilities through its client SDKs and HTTP and XMPP server protocols. For deployments with more complex messaging requirements, FCM is the right choice.
Here's a comparison of the messaging capabilities provided by Firebase Cloud Messaging and the Notifications composer:
能力 | Notifications composer | 雲端訊息傳遞 | |
---|---|---|---|
目標 | Single device | ||
Clients subscribed to topics (ie weather) | |||
Clients in predefined user segment (app, version, language) | |||
Clients in specified analytics audiences | |||
Clients in device groups | |||
Upstream from client to server | |||
訊息類型 | Notifications up to 2kb | ||
Data messages up to 4kb | |||
送貨 | 即時 | ||
Future client device local time | |||
分析 | Built-in Notifications analytics collection and funnel analytics |
Notifications composer: I am an existing Google Cloud Messaging (GCM) developer, and I want to use the Notifications composer.我該怎麼辦?
The Notifications composer is an out-of-the-box solution that lets anyone send notifications to target specific audiences based on insights from Google Analytics. Also, the Notifications composer provides funnel analysis for every message, allowing easy evaluation of notification effectiveness.
If you are an existing GCM developer, to use the Notifications composer you have to upgrade from GCM SDKs to FCM SDKs. See the guides for migrating Android and iOS apps.
FCM features deprecated in June 2023
Which FCM APIs were deprecated on June 20, 2023, and what should I do if I am using those APIs?
The following APIs/SDKs will be affected by the deprecation:
伺服器API
API名稱 | API端點 | Impact on users | 需要採取的行動 |
---|---|---|---|
Legacy HTTP protocol | https://fcm.googleapis.com/fcm/send | Requests to the endpoint will start failing after 6/21/2024. | Migrate to the HTTP v1 API . |
Legacy XMPP protocol | fcm-xmpp.googleapis.com:5235 | Requests to the endpoint will start failing after 6/21/2024. | Migrate to the HTTP v1 API . |
Instance ID server APIs | https://iid.googleapis.com/v1/web/iid | Requests to the endpoint will start failing after 6/21/2024. | Use the Web JS SDK to create FCM web registrations. |
https://iid.googleapis.com/iid/* | The endpoints will continue to work but they won't support authentication using static server keys after 6/21/2024. | Use an OAuth 2.0 access token derived from a service account. | |
Device group management API | https://fcm.googleapis.com/fcm/notification | The endpoint will continue to work but it won't support authentication using static server keys after 6/21/2024. | Use an OAuth 2.0 access token derived from a service account. |
Upstream messaging via XMPP | fcm-xmpp.googleapis.com:5235 | API calls to FirebaseMessaging.send in the app won't trigger upstream messages to the app server after 6/21/2024. | Implement this functionality in your server logic. For example, some developers implement their own HTTP/gRPC endpoint and call the endpoint directly to send messages from their clients to the app server. See this gRPC Quick start for an example implementation of upstream messaging using gRPC. |
Batch Send API | https://fcm.googleapis.com/batch | Requests to the endpoint will start failing after 6/21/2024. | Migrate to the standard HTTP v1 API send method , which supports HTTP/2 for multiplexing. |
Firebase Admin SDK APIs
API名稱 | API Language | Impact on users | 需要採取的行動 |
---|---|---|---|
sendToDevice() | Node.js | The API will stop working after 6/21/2024 because it calls the legacy HTTP send API. | Use the send() method. |
sendToDeviceGroup() | Node.js | The API will stop working after 6/21/2024 because it calls the legacy HTTP send API. | Use the send() method. |
sendAll()/sendAllAsync()/send_all()/sendMulticast()/SendMulticastAsync()/send_multicast() | Node.js, Java, Python, Go, C# | These APIs will stop working after 6/21/2024 because they call the batch send API . | Upgrade to the latest Firebase Admin SDK and use the new APIs instead: sendEach()/ sendEachAsync()/send_each()/sendEachForMulticast()/sendEachForMulticastAsync()/ send_each_for_multicast() .Note that the new APIs no longer call the deprecated batch send API, and for this reason they may create more concurrent HTTP connections than the old APIs. |
Client SDKs
SDK versions | Impact on users | 需要採取的行動 |
---|---|---|
GCM SDKs (deprecated in 2018) | Apps using GCM SDKs will not be able to register tokens nor receive messages from FCM after 6/21/2024. | Upgrade your Android SDK to the latest Firebase SDK if you haven't already done so. |
JS SDKs version <7.0.0 (breaking change at version 7.0.0 in 2019) | Web apps using older JS SDKs will not be able to register tokens after 6/21/2024. | Upgrade your Firebase Web SDK to the latest version. |
Will I see a service downgrade before June 2024?
No. You have 12 months (06/20/2023 - 06/21/2024) to migrate from the old APIs to new APIs without any service downgrade. We strongly recommend you to plan the migration as early as possible so you won't be impacted by the decommissioning of the APIs in June 2024.
After June 2024, you may see increased errors or lack of functionality when using the APIs/SDKs listed above.
What's the difference between OAuth 2.0 tokens and server keys?
An OAuth 2.0 token is a short-lived token derived from a service account . It's Google's standard auth model and it's more secure than static server keys.
See Use credentials to mint access tokens for guidance on using the Google Auth Library to obtain tokens.
Note that the request headers differ when you use OAuth 2.0 tokens for requests to different endpoints.
- HTTP v1 API :
Authorization: Bearer $oauth_token
- Instance ID server API and Device group management API :
Authorization: Bearer $oauth_token
access_token_auth: true
Can I migrate my requests to the new API all at once?
We recommend that you slowly ramp up your traffic to the new API. If you expect to send more than 600,000 messages/min on a regular basis, contact Firebase support for instructions on how to increase quota or get recommendations on how to spread out traffic.
What's the difference between the HTTP v1 API and the legacy APIs when I send messages to topics/device groups?
Topics: you don't need to add the "/topics/" prefix to your topic target when you use the v1 API.
Device groups: You can use a group token as a token target in the HTTP v1 API. However, the HTTP v1 API doesn't return the success/failure counts in the response. We recommend that you use FCM topics or manage your device groups by yourself.
Does the HTTP v1 API support sending messages to multiple tokens in one request?
No. This feature, called "multicast" in legacy HTTP APIs, is not supported by the HTTP v1 API, which is better designed for scalability.
For use cases where end-to-end latency is critical, or where total fanout size is small (fewer than 1 million), Google recommends sending multiple separate requests using the HTTP v1 API. The HTTP v1 API over HTTP/2 performs similarly for 99.9% of multicast requests (sending < 100 tokens). For outlier use cases (sending 1000 tokens), it achieves up to a third of the throughput rate, so additional concurrency is needed to optimize for this atypical use case. Users can experience more reliability and availability with the HTTP v1 API than with legacy multicast.
For use cases where throughput and egress bandwidth are prioritized or where total fanout size is large (greater than 1 million), Google recommends topic messaging. While topic messaging requires a one-time action to subscribe recipients to a topic, it offers up to a 10,000 QPS per project fanout rate without a maximum limit on topic size.
What versions of the Firebase Admin SDK have the new APIs?
平台 | Firebase Admin SDK version |
---|---|
Node.js | >=11.7.0 |
Python | >=6.2.0 |
爪哇 | >=9.2.0 |
去 | >=4.12.0 |
。網 | >=2.4.0 |
What's the difference between the batch send API and the HTTP v1 API?
The FCM batch send API uses the same message format and authentication mechanism as the HTTP v1 API. However, it uses a different endpoint. If you want to improve efficiency, you should consider using HTTP/2 to send multiple requests over the same HTTP connection to the HTTP v1 API.
What should I do if I can't access my project?
Please reach out to the Google Cloud support team for help.
Firebase 雲端儲存
Cloud Storage for Firebase: Why can't I use Cloud Storage for Firebase?
Cloud Storage for Firebase creates a default bucket in the App Engine no-cost tier. This allows you to quickly get up and running with Firebase and Cloud Storage for Firebase, without having to put in a credit card or enable a Cloud Billing account. It also allows you to easily share data between Firebase and a Google Cloud project.
There are, however, two known cases where this bucket cannot be created and you will be unable to use Cloud Storage for Firebase:
- A project imported from Google Cloud which had a App Engine Master/Slave Datastore application.
- A project imported from Google Cloud which has domain prefixed projects. For example:
domain.com:project-1234
.
There are currently no workarounds to these issues, and we recommend that you create a new project in the Firebase console and enable Cloud Storage for Firebase in that project.
Cloud Storage for Firebase: Why do I get error code 412 responses about service account permissions and failed service account operations when using the Cloud Storage for Firebase API?
It's likely you're getting 412 error codes either because the Cloud Storage for Firebase API is not enabled for your project or a necessary service account is missing the required permissions.
See the related FAQ .
Cloud Storage for Firebase: On Spark plan projects, can I store executable files?
For no-cost (Spark) plan projects, Firebase blocks uploads and hosting of certain executable file types for Windows, Android and Apple by Cloud Storage for Firebase and Firebase Hosting. This policy exists to prevent abuse on our platform.
Serving, hosting and file uploads of disallowed files are blocked for all Spark projects created on or after Sept 28th, 2023. For existing Spark projects with files uploaded before that date, such files can still be uploaded and hosted.
This restriction applies to Spark plan projects. Projects on the pay as you go (Blaze) plan are not affected.
The following file types cannot be hosted on Firebase Hosting and Cloud Storage for Firebase:
- Windows files with
.exe
,.dll
and.bat
extensions - Android files with
.apk
extension - Apple platform files with
.ipa
extension
我需要做什麼?
If you still want to host these file types after September 28th, 2023:
- For Hosting: upgrade to the Blaze plan before you can deploy these file types to Firebase Hosting via the
firebase deploy
command. - For Storage: upgrade to the Blaze plan to upload these file types to the bucket of your choice using the GCS CLI, the Firebase console, or Google Cloud Console.
Use Firebase tools to manage your Firebase Hosting and Cloud Storage resources.
- For managing resources in Firebase Hosting, use the Firebase console to delete releases according to this guide .
- For managing resources in Cloud Storage, navigate to the Storage product page in your project.
- On the Files tab, locate disallowed files to delete in your folder hierarchy, then select them using the checkbox next to the filename(s) on the left-hand side of the panel.
- Click Delete , and confirm the files were deleted.
Please refer to our documentation for additional information on managing Hosting resources with Firebase tools and Cloud Storage for Firebase buckets with client libraries .
Cloud Storage for Firebase: Why do I see an unexpected increase in upload and download operations?
Previously, download and upload requests to the Cloud Storage for Firebase API were not being counted properly. We have taken steps to fix this issue, starting from September 15, 2023.
For Blaze users, upload and download operations will start counting towards your monthly bill. For Spark users, they will start counting towards your monthly free limit.
We recommend monitoring your Usage page for any increases that may count towards your limits.
Cloud Storage for Firebase: Why do I see new service account IDs associated with my Firebase projects that use Cloud Storage for Firebase?
Firebase uses service accounts to operate and manage services without sharing user credentials. When you create a Firebase project, you might notice that a number of service accounts are already available in your project.
The service account that Cloud Storage for Firebase uses is scoped to your project and is named
service- PROJECT_NUMBER @gcp-sa-firebasestorage.iam.gserviceaccount.com
.
If you used Cloud Storage for Firebase before September 19, 2022, you may see an additional service account on previously-linked Cloud Storage buckets named firebase-storage@system.gserviceaccount.com
. As of September 19, 2022, this service account is no longer supported.
You can view all service accounts associated with your project in the Firebase console, on the Service accounts tab .
Adding the new service account
If you removed the service account previously or the service account is not present in your project, you may do one of the following to add the account.
- (Recommended) Automated: Use the AddFirebase REST endpoint to re-import your bucket into Firebase. You will only need to call this endpoint once, not once for each linked bucket.
- Manual: Follow the steps in Creating and managing service accounts . Following that guide, add a service account with the IAM role
Cloud Storage for Firebase Service Agent
, and service account name
service- PROJECT_NUMBER @gcp-sa-firebasestorage.iam.gserviceaccount.com
.
Removing the new service account
We strongly discourage you from removing the service account because this may block access to your Cloud Storage buckets from your apps. To remove the service account from your project, follow the instructions in Disabling a service account .
崩潰解決方案
Visit the Crashlytics troubleshooting & FAQ page for helpful tips and answers to more FAQs.
動態連結
Dynamic Links: What are Firebase's future plans for Dynamic Links?
See Dynamic Links FAQ .
Dynamic Links: Why does my Android app access each Dynamic Link twice?
The getInvitation
API clears the saved Dynamic Link to prevent it from being accessed twice. Be sure to call this API with the autoLaunchDeepLink
parameter set to false
in each of the deep link activities to clear it for the case when the activity is triggered outside the main activity.
Firebase Local Emulator Suite
Why do Emulator Suite logs show an error starting with "Multiple projectIds are not recommended in single project mode"?
This message means the Emulator Suite has detected it may be running a particular product emulator using different project IDs. This may indicate a misconfiguration, and can cause issues when emulators try to communicate with one another, and when you try to interact with emulators from your code. If project IDs don't match, it often appears that data is missing, since data stored in emulators is keyed to projectID, and interoperability depends on matching project IDs.
This has been a common source of confusion among developers, so by default the Local Emulator Suite will now only allow running with a single project ID, unless you specify otherwise in the firebase.json
configuration file. If an emulator detects more than one project ID, it will log a warning and potentially throw a fatal error.
Check your project ID declaration(s) for mismatches in:
- The default project set at the command line. By default, the project ID will be taken on startup from the project selected with
firebase init
orfirebase use
. To view the list of projects (and see which one is selected) usefirebase projects:list
. - Unit tests. The project ID is often specified in calls to the Rules Unit Testing library methods
initializeTestEnvironment
orinitializeTestApp
. Other testing code may initialize withinitializeApp(config)
. - The command line
--project
flag. Passing the Firebase CLI--project
flag overrides the default project. You'll need to ensure the value of the flag matches the project ID in unit tests and app initialization.
Platform-specific places to check:
網路 | The projectId property in your JavaScript firebaseConfig object, used in initializeApp . |
安卓 | The project_id property inside the google-services.json configuration file. |
蘋果平台 | The PROJECT_ID property in the GoogleService-Info.plist configuration file. |
To disable single project mode, update firebase.json
with the singleProjectMode
key:
{ "firestore": { ... }, "functions": { ... }, "hosting": { ... }, "emulators": { "singleProjectMode": false, "auth": { "port": 9099 }, "functions": { "port": 5001 }, ... } }
託管
Hosting: On Spark plan projects, can I store executable files?
For no-cost (Spark) plan projects, Firebase blocks uploads and hosting of certain executable file types for Windows, Android and Apple by Cloud Storage for Firebase and Firebase Hosting. This policy exists to prevent abuse on our platform.
Serving, hosting and file uploads of disallowed files are blocked for all Spark projects created on or after Sept 28th, 2023. For existing Spark projects with files uploaded before that date, such files can still be uploaded and hosted.
This restriction applies to Spark plan projects. Projects on the pay as you go (Blaze) plan are not affected.
The following file types cannot be hosted on Firebase Hosting and Cloud Storage for Firebase:
- Windows files with
.exe
,.dll
and.bat
extensions - Android files with
.apk
extension - Apple platform files with
.ipa
extension
我需要做什麼?
If you still want to host these file types after September 28th, 2023:
- For Hosting: upgrade to the Blaze plan before you can deploy these file types to Firebase Hosting via the
firebase deploy
command. - For Storage: upgrade to the Blaze plan to upload these file types to the bucket of your choice using the GCS CLI, the Firebase console, or Google Cloud Console.
Use Firebase tools to manage your Firebase Hosting and Cloud Storage resources.
- For managing resources in Firebase Hosting, use the Firebase console to delete releases according to this guide .
- For managing resources in Cloud Storage, navigate to the Storage product page in your project.
- On the Files tab, locate disallowed files to delete in your folder hierarchy, then select them using the checkbox next to the filename(s) on the left-hand side of the panel.
- Click Delete , and confirm the files were deleted.
Please refer to our documentation for additional information on managing Hosting resources with Firebase tools and Cloud Storage for Firebase buckets with client libraries .
Hosting: Why does my Hosting release history table in the Firebase console show file counts that are more than what my local project actually has?
Firebase automatically adds extra files containing metadata about the Hosting site, and these files are included in the total file count for the release.
Hosting: What's the largest file size that I can deploy to Firebase Hosting?
Hosting has a maximum size limit of 2 GB for individual files.
We recommend storing larger files using Cloud Storage , which offers a maximum size limit in the terabyte range for individual objects.
Hosting: How many Hosting sites can I have per Firebase project?
The Firebase Hosting multisite feature supports a maximum of 36 sites per project.
效能監控
Visit the Performance Monitoring troubleshooting & FAQ page for helpful tips and answers to more FAQs.
Performance Monitoring: How many custom URL patterns can I create?
You can create up to 400 total custom URL patterns per app and up to 100 custom URL patterns per domain for that app.
Performance Monitoring: Why am I not seeing real time display of performance data?
To view real time performance data, make sure that your app uses a Performance Monitoring SDK version that's compatible with real time data processing.
- iOS — v7.3.0 or later
- tvOS — v8.9.0 or later
- Android — v19.0.10 or later (or Firebase Android BoM v26.1.0 or later)
- Web — v7.14.0 or later
Note that we always recommend using the latest version of SDK, but any version listed above will enable Performance Monitoring to process your data in near real time.
即時資料庫
Realtime Database: Why was my Realtime Database reported bandwidth lower than average between September 2016 and March 2017?
For our bandwidth calculations, we normally include SSL encryption overhead (based on layer 5 of the OSI model). However, in September 2016, we introduced a bug that caused our bandwidth reporting to ignore encryption overhead. This might have resulted in artificially low reported bandwidth and bills on your account for a few months.
We released a fix for the bug in late March 2017, returning bandwidth reporting and billing to their normal levels.
Realtime Database: What are the scaling limitations of the Realtime Database?
Each Realtime Database instance has limits on the number of write operations per second. For small writes, this limit is approximately 1000 write operations per second. If you are approaching this limit, batching operations using multi-path updates can help you achieve higher throughput.
In addition, each database instance has a cap on the number of simultaneous database connections . Our default limits are large enough for most applications. If you are building an app that requires additional scale, you may need to shard your application across multiple database instances for added scale. You may also consider Cloud Firestore as an alternative database.
Realtime Database: What can I do if I'm over my Realtime Database usage limits?
If you've received an email alert or notification in the Firebase console that you've exceeded your Realtime Database usage limits, you can address it based on the usage limit you've exceeded. To see your Realtime Database usage, go to the Realtime Database Usage dashboard in the Firebase console.
If you're over your download limit, you can upgrade your Firebase pricing plan or wait until your download limit resets at the start of your next billing cycle. To decrease your downloads, try the following steps:
- Add queries to limit the data that your listen operations return.
- Check for unindexed queries.
- Use listeners that only download updates to data — for example,
on()
instead ofonce()
. - Use security rules to block unauthorized downloads.
If you're over your storage limit, upgrade your pricing plan to avoid service disruptions. To reduce the amount of data in your database, try the following steps:
- Run periodic cleanup jobs.
- Reduce any duplicate data in your database.
Note that it may take some time to see any data deletions reflected in your storage allotment.
If you're over your simultaneous database connections limit, upgrade your plan to avoid any service disruptions. To manage simultaneous connections to your database, try connecting via users via the REST API if they don't require a realtime connection.
遠端配置
Remote Config: Why don't fetched values change the behavior and appearance of my app?
Unless you fetch values with fetchAndActivate()
, values are stored locally but not activated. To activate fetched values so that they can take effect, call activate
. This design lets you control when the behavior and appearance of your app changes, because you can choose when to call activate
. After you call activate
, your app source code determines when updated parameter values are used.
For example, you could fetch values and then activate them the next time a user starts your app, which removes the need to delay app startup while your app waits for fetched values from the service. Changes to your app's behavior and appearance then occur when your app uses the updated parameter values.
To learn more about the Remote Config API and usage model, see Remote Config API Overview .
Remote Config: I am making a lot of fetch requests while developing my app. Why doesn't my app always get the latest values from the service when it sends fetch requests?
During app development, you might want to fetch and activate configs very frequently (many times per hour) to let you rapidly iterate as you develop and test your app. To accommodate rapid iteration on a project with up to 10 developers, you can temporarily set a FirebaseRemoteConfigSettings
object with a low minimum fetch interval ( setMinimumFetchIntervalInSeconds
) in your app.
Remote Config: How quickly does the Remote Config service return fetched values after my app sends a fetch request?
Devices usually receive fetched values in less than a second, and often receive fetched values in milliseconds. The Remote Config service handles fetch requests within milliseconds, but the time required to complete a fetch request will depend on the network speed of the device and the latency of the network connection used by the device.
If your goal is to make fetched values take effect in your app as soon as possible, but without creating a jarring user experience, consider adding calls to fetchAndActivate
each time that your app does a full screen refresh.
測試實驗室
Visit the Test Lab troubleshooting page for helpful tips and answers to FAQs.
Firebase User Segmentation Storage
What is Firebase User Segmentation Storage?
Firebase User Segmentation Storage stores Firebase installation IDs and related attributes and segments as well as audience lists you've created to provide targeting information to other Firebase services that use them, such as Crashlytics, FCM, Remote Config personalization, and more.