某些 Firebase Android SDK 依賴Google Play 服務,這意味著它們只能在安裝了 Google Play 服務的裝置和模擬器上運行。這些 Firebase SDK 與裝置上的 Google Play 服務後台服務通信,為您的應用程式提供安全、最新且輕量級的 API。某些 Android 裝置(例如 Amazon Kindle Fire 裝置或在某些地區銷售的裝置)未安裝 Google Play 服務。
哪些 Firebase Android SDK 需要 Google Play 服務?
Firebase SDK 可分為三類:
- 需要 Play 服務- 這些 SDK 需要 Google Play 服務,否則它們沒有任何功能。
- 推薦的 Play 服務- 這些 SDK 要求 Google Play 服務具有完整的功能,但即使沒有 Google Play 服務,它們仍然提供大部分功能。
- 不需要 Play 服務- 這些 SDK 不需要 Google Play 服務具有完整的功能。
下表僅適用於每個 SDK 的最新版本。一些舊版本可能有更嚴格的要求。
不需要Google Play 服務
產品 | 圖書館 | 谷歌播放服務? |
---|---|---|
應用程式檢查自訂和調試提供者 | com.google.firebase:firebase-appcheck:17.0.1 com.google.firebase:firebase-appcheck-ktx:17.0.1 com.google.firebase:firebase-appcheck-debug:17.0.1 | 不需要 |
應用程式分發API | com.google.firebase:firebase-appdistribution-api:16.0.0-beta10 com.google.firebase:firebase-appdistribution-api-ktx:16.0.0-beta10 | 不需要 |
應用程式分發 | com.google.firebase:firebase-appdistribution:16.0.0-beta10 | 不需要 |
驗證 | com.google.firebase:firebase-auth:22.1.2 com.google.firebase:firebase-auth-ktx:22.1.2 | 不需要 |
雲端Firestore | com.google.firebase:firebase-firestore:24.8.1 com.google.firebase:firebase-firestore-ktx:24.8.1 | 不需要 |
Firebase 用戶端 SDK 的雲端函數 | com.google.firebase:firebase-functions:20.3.1 com.google.firebase:firebase-functions-ktx:20.3.1 | 不需要 |
Firebase 雲端儲存 | com.google.firebase:firebase-storage:20.2.1 com.google.firebase:firebase-storage-ktx:20.2.1 | 不需要 |
崩潰解決方案 | com.google.firebase:firebase-crashlytics:18.4.3 com.google.firebase:firebase-crashlytics-ktx:18.4.3 | 不需要 |
應用程式內訊息傳遞 | com.google.firebase:firebase-inappmessaging:20.3.5 com.google.firebase:firebase-inappmessaging-ktx:20.3.5 | 不需要 |
應用程式內訊息顯示 | com.google.firebase:firebase-inappmessaging-display:20.3.5 com.google.firebase:firebase-inappmessaging-display-ktx:20.3.5 | 不需要 |
Firebase 安裝 | com.google.firebase:firebase-installations:17.1.4 com.google.firebase:firebase-installations-ktx:17.1.4 | 不需要 |
效能監控 | com.google.firebase:firebase-perf:20.4.1 com.google.firebase:firebase-perf-ktx:20.4.1 | 不需要 |
即時資料庫 | com.google.firebase:firebase-database:20.2.2 com.google.firebase:firebase-database-ktx:20.2.2 | 不需要 |
遠端配置 | com.google.firebase:firebase-config:21.4.1 com.google.firebase:firebase-config-ktx:21.4.1 | 不需要 |
需要或推薦的 Google Play 服務
產品 | 圖書館 | 谷歌播放服務? |
---|---|---|
AdMob | com.google.android.gms:播放服務廣告:22.4.0 | 受到推崇的* |
分析 | com.google.firebase:firebase-analytics:21.3.0 com.google.firebase:firebase-analytics-ktx:21.3.0 | 受到推崇的* |
應用程式檢查播放完整性提供者 | com.google.firebase:firebase-appcheck-playintegrity:17.0.1 | 必需的 |
應用程式檢查 SafetyNet 供應商 | com.google.firebase:firebase-appcheck-safetynet:16.1.2 | 必需的 |
應用程式索引 | com.google.firebase:firebase-appindexing:20.0.0 | 必需的 |
雲端訊息傳遞 | com.google.firebase:firebase-messaging:23.2.1 com.google.firebase:firebase-messaging-ktx:23.2.1 | 必需的 |
動態連結 | com.google.firebase:firebase-dynamic-links:21.1.0 com.google.firebase:firebase-dynamic-links-ktx:21.1.0 | 必需的 |
Firebase ML 視覺 | com.google.firebase:firebase-ml-vision:24.1.0 | 必需的 |
Firebase ML 自訂模型 | com.google.firebase:firebase-ml-model-interpreter:22.0.4 | 必需的 |
* 適用於 Google Analytics 的 Firebase SDK 可以在任何裝置上傳送事件,但某些自動洞察(例如人口統計資料)僅在具有 Google Play 服務的裝置上可用。