部分 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 服務,這些 SDK 仍可提供「大部分」功能。
- 不需要 Play 服務:這些 SDK 不需要 Google Play 服務就能享有完整功能。
下表僅針對各個 SDK 的最新版本提供正確的資訊。部分較舊的版本可能有更嚴格的規定。
不必須使用 Google Play 服務
產品 | 程式庫 | Google Play 服務? |
---|---|---|
App Check 自訂和偵錯提供者 | com.google.firebase:firebase-appcheck:18.0.0 com.google.firebase:firebase-appcheck-ktx:18.0.0 com.google.firebase:firebase-appcheck-debug:18.0.0 |
非必要 |
應用程式發布 API | com.google.firebase:firebase-appdistribution-api:16.0.0-beta12 com.google.firebase:firebase-appdistribution-api-ktx:16.0.0-beta12 |
非必要 |
應用程式發布 | com.google.firebase:firebase-appdistribution:16.0.0-beta12 | 非必要 |
驗證 | com.google.firebase:firebase-auth:23.0.0 com.google.firebase:firebase-auth-ktx:23.0.0 |
非必要 |
Cloud Firestore | com.google.firebase:firebase-firestore:25.0.0 com.google.firebase:firebase-firestore-ktx:25.0.0 |
非必要 |
Cloud Functions for Firebase 用戶端 SDK | com.google.firebase:firebase-functions:21.0.0 com.google.firebase:firebase-functions-ktx:21.0.0 |
非必要 |
Cloud Storage for Firebase | com.google.firebase:firebase-storage:21.0.0 com.google.firebase:firebase-storage-ktx:21.0.0 |
非必要 |
Crashlytics | com.google.firebase:firebase-crashlytics:19.0.0 com.google.firebase:firebase-crashlytics-ktx:19.0.0 |
非必要 |
應用程式內通訊 | com.google.firebase:firebase-inappmessaging:21.0.0 com.google.firebase:firebase-inappmessaging-ktx:21.0.0 |
非必要 |
應用程式內通訊顯示 | com.google.firebase:firebase-inappmessaging-display:21.0.0 com.google.firebase:firebase-inappmessaging-display-ktx:21.0.0 |
非必要 |
Firebase 安裝 | com.google.firebase:firebase-installations:18.0.0 com.google.firebase:firebase-installations-ktx:18.0.0 |
非必要 |
Performance Monitoring | com.google.firebase:firebase-perf:21.0.0 com.google.firebase:firebase-perf-ktx:21.0.0 |
非必要 |
即時資料庫 | com.google.firebase:firebase-database:21.0.0 com.google.firebase:firebase-database-ktx:21.0.0 |
非必要 |
遠端設定 | com.google.firebase:firebase-config:22.0.0 com.google.firebase:firebase-config-ktx:22.0.0 |
非必要 |
Vertex AI for Firebase | com.google.firebase:firebase-vertexai:16.0.0-beta01 | 非必要 |
需要或建議的 Google Play 服務
產品 | 程式庫 | Google Play 服務? |
---|---|---|
AdMob | com.google.android.gms:play-services-ads:23.1.0 | 建議採用* |
數據分析 | com.google.firebase:firebase-analytics:22.0.0 com.google.firebase:firebase-analytics-ktx:22.0.0 |
建議採用* |
App Check Play Integrity 供應商 | com.google.firebase:firebase-appcheck-playintegrity:18.0.0 | 必填 |
App Check SafetyNet 供應商 | com.google.firebase:firebase-appcheck-safetynet:16.1.2 | 必填 |
應用程式索引 | com.google.firebase:firebase-appindexing:20.0.0 | 必填 |
雲端通訊 | com.google.firebase:firebase-messaging:24.0.0 com.google.firebase:firebase-messaging-ktx:24.0.0 |
必填 |
Dynamic Links | com.google.firebase:firebase-dynamic-links:22.0.0 com.google.firebase:firebase-dynamic-links-ktx:22.0.0 |
必填 |
Firebase ML Vision | 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 服務的裝置。