Sự phụ thuộc của SDK Android của Firebase trong Dịch vụ Google Play

Một số SDK Firebase Android phụ thuộc vào Google Play services, nghĩa là các SDK này sẽ chỉ chạy trên các thiết bị và trình mô phỏng đã cài đặt Google Play services. Các SDK Firebase này giao tiếp với dịch vụ nền Google Play services trên thiết bị để cung cấp API an toàn, mới nhất và gọn nhẹ cho ứng dụng của bạn. Một số thiết bị Android, chẳng hạn như thiết bị Amazon Kindle Fire hoặc các thiết bị được bán ở một số khu vực, không cài đặt Google Play services.

SDK Firebase Android nào yêu cầu Google Play services?

Có thể chia SDK Firebase thành 3 danh mục:

  • Bắt buộc phải có Play services – Các SDK này yêu cầu Google Play services, nếu không sẽ không có chức năng.
  • Nên dùng Play services – Các SDK này yêu cầu Google Play services để có chức năng đầy đủ, nhưng vẫn cung cấp hầu hết chức năng ngay cả khi không có Google Play services.
  • Không bắt buộc phải có Play services – Các SDK này không yêu cầu Google Play services phải có đầy đủ chức năng.

Các bảng dưới đây chỉ chính xác đối với bản phát hành mới nhất của từng SDK. Một số phiên bản cũ có thể có các yêu cầu nghiêm ngặt hơn.

Google Play services không bắt buộc

Product Thư viện Google Play services?
Nhà cung cấp gỡ lỗi và tuỳ chỉnh 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
Không bắt buộc
API App Distribution com.google.firebase:firebase-appdistribution-api:16.0.0-beta14
com.google.firebase:firebase-appdistribution-api-ktx:16.0.0-beta14
Không bắt buộc
App Distribution com.google.firebase:firebase-appdistribution:16.0.0-beta14 Không bắt buộc
Authentication com.google.firebase:firebase-auth:23.2.0
com.google.firebase:firebase-auth-ktx:23.2.0
Không bắt buộc
Cloud Firestore com.google.firebase:firebase-firestore:25.1.2
com.google.firebase:firebase-firestore-ktx:25.1.2
Không bắt buộc
Cloud Functions for Firebase Client SDK com.google.firebase:firebase-functions:21.1.1
com.google.firebase:firebase-functions-ktx:21.1.1
Không bắt buộc
Cloud Storage for Firebase com.google.firebase:firebase-storage:21.0.1
com.google.firebase:firebase-storage-ktx:21.0.1
Không bắt buộc
Crashlytics com.google.firebase:firebase-crashlytics:19.4.1
com.google.firebase:firebase-crashlytics-ktx:19.4.1
Không bắt buộc
In-App Messaging com.google.firebase:firebase-inappmessaging:21.0.1
com.google.firebase:firebase-inappmessaging-ktx:21.0.1
Không bắt buộc
In-App Messaging Màn hình com.google.firebase:firebase-inappmessaging-display:21.0.1
com.google.firebase:firebase-inappmessaging-display-ktx:21.0.1
Không bắt buộc
Firebase lượt cài đặt com.google.firebase:firebase-installations:18.0.0
com.google.firebase:firebase-installations-ktx:18.0.0
Không bắt buộc
Performance Monitoring com.google.firebase:firebase-perf:21.0.4
com.google.firebase:firebase-perf-ktx:21.0.4
Không bắt buộc
Realtime Database com.google.firebase:firebase-database:21.0.0
com.google.firebase:firebase-database-ktx:21.0.0
Không bắt buộc
Remote Config com.google.firebase:firebase-config:22.1.0
com.google.firebase:firebase-config-ktx:22.1.0
Không bắt buộc
Vertex AI in Firebase com.google.firebase:firebase-vertexai:16.2.0 Không bắt buộc
Product Thư viện Google Play services?
AdMob com.google.android.gms:play-services-ads:24.0.0 Nên dùng*
Analytics com.google.firebase:firebase-analytics:22.3.0
com.google.firebase:firebase-analytics-ktx:22.3.0
Nên dùng*
App Check Nhà cung cấp API Tính toàn vẹn của Play com.google.firebase:firebase-appcheck-playintegrity:18.0.0 Bắt buộc
App Check Nhà cung cấp SafetyNet com.google.firebase:firebase-appcheck-safetynet:16.1.2 Bắt buộc
App Indexing com.google.firebase:firebase-appindexing:20.0.0 Bắt buộc
Cloud Messaging com.google.firebase:firebase-messaging:24.1.0
com.google.firebase:firebase-messaging-ktx:24.1.0
Bắt buộc
Dynamic Links com.google.firebase:firebase-dynamic-links:22.1.0
com.google.firebase:firebase-dynamic-links-ktx:22.1.0
Bắt buộc
Firebase ML Vision com.google.firebase:firebase-ml-vision:24.1.0 Bắt buộc
Firebase ML Mô hình tuỳ chỉnh com.google.firebase:firebase-ml-model-interpreter:22.0.4 Bắt buộc

* SDK Firebase cho Google Analytics có thể gửi sự kiện trên mọi thiết bị, nhưng một số thông tin chi tiết tự động như thông tin nhân khẩu học chỉ có trên các thiết bị có Google Play services.