Khắc phục sự cố và câu hỏi thường gặp cho các nền tảng của Apple và Firebase
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Trang này cung cấp các mẹo và thông tin khắc phục sự cố cụ thể liên quan đến nền tảng Apple mà bạn có thể gặp phải khi sử dụng Firebase.
Bạn gặp phải những thách thức khác hoặc không thấy vấn đề của mình được nêu bên dưới? Hãy nhớ xem Câu hỏi thường gặp chính về Firebase để biết thêm câu hỏi thường gặp chung về Firebase hoặc câu hỏi thường gặp dành riêng cho sản phẩm.
Firebase hỗ trợ tối đa 2 phiên bản chính của Xcode, không bao gồm các phiên bản Xcode mà Apple không còn hỗ trợ. Ví dụ: kể từ tháng 3 năm 2019, Apple yêu cầu tất cả ứng dụng phải có ít nhất iOS 12, tức là không còn hỗ trợ Xcode 9 và Xcode 10 là phiên bản chính duy nhất được hỗ trợ.
Ứng dụng của tôi nhắc người dùng nhập mật khẩu để truy cập vào các mục trong Keychain trên macOS. Làm cách nào để tôi chữa lỗi này?
Nâng cấp phần phụ thuộc Firebase lên phiên bản 9.6.0 trở lên và thêm [khả năng Chia sẻ chuỗi khoá](/docs/ios/troubleshooting-faq#macos-keychain-sharing) vào mục tiêu của bạn.
Tại sao Firebase yêu cầu tính năng Chia sẻ chuỗi khoá trên macOS?
SDK Firebase sử dụng chuỗi khoá để lưu trữ thông tin như mã nhận dạng lượt cài đặt Firebase dùng cho FCM. Nếu không có quyền truy cập vào Keychain, Firebase SDK có thể không hoạt động đúng cách. Keychain trên macOS hoạt động khác với keychain kiểu iOS được dùng trên các nền tảng khác (iOS, tvOS, macCatalyst và watchOS).
Trên macOS, các ứng dụng sử dụng một chuỗi khoá dùng chung mà các ứng dụng và quy trình khác có thể sửa đổi. Không giống như iOS, không có chuỗi khoá được cách ly mà ứng dụng có quyền truy cập ngầm. Vì vậy, khi một ứng dụng Mac tương tác với chuỗi khoá, hệ thống sẽ nhắc người dùng cấp quyền truy cập vì ứng dụng Mac có thể đang sửa đổi một mục trong chuỗi khoá mà ứng dụng đó không tạo. Để giải quyết sự khác biệt này, Firebase truy vấn chuỗi khoá bằng khoá kSecUseDataProtectionKeychain, cho biết ứng dụng sẽ truy vấn một mục trong chuỗi khoá thuộc một nhóm truy cập chuỗi khoá (đây là hành vi mặc định trên các nền tảng khác). Bạn cần có khả năng Chia sẻ chuỗi khoá vì ứng dụng cần khả năng này để tổng hợp một nhóm truy cập có thể được chia sẻ giữa các mục tiêu của ứng dụng, nhờ đó cấp quyền cho ứng dụng tự do truy cập vào các mục trong chuỗi khoá trong nhóm truy cập.
Trong Xcode phiên bản 13 trở lên, tại sao các ứng dụng UIKit của tôi không mở được một số URL mà tôi đã đăng ký trong Info.plist?
Apple đã đưa ra giới hạn là 50 mục LSApplicationQueriesSchemes trong tệp Info.plist. Vào năm 2015, Apple đã giới thiệu LSApplicationQueriesSchemes để giới hạn số lượng truy vấn URL mà mỗi ứng dụng có thể thực hiện. Khi Xcode 13 được phát hành, các giới hạn này sẽ được thực thi, trong khi ở Xcode 12 trở về trước, số lượng lược đồ không có giới hạn hiệu quả.
Một số sản phẩm của Firebase, chẳng hạn như Firebase Authentication và Firebase Dynamic Links, yêu cầu bạn sử dụng các lược đồ URL tuỳ chỉnh để chuyển hướng đến ứng dụng của mình. Những URL này tuân thủ một lược đồ URL ngắn gọn và nhất quán, không được tính đáng kể vào giới hạn 50 lược đồ liên kết.
Xin lưu ý rằng đối với những ứng dụng tiếp tục đăng ký hơn 50 LSApplicationQueriesSchemes, một số lược đồ sẽ bị bỏ qua một cách âm thầm. Ứng dụng có thể không thực thi được một số đường liên kết sâu nhất định, tuỳ thuộc vào thứ tự thêm các đường liên kết đó.
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 2025-09-05 UTC."],[],[],null,["\u003cbr /\u003e\n\nThis page offers tips and troubleshooting for Apple platform-specific issues\nthat you might encounter when using Firebase.\n\nHave other challenges or don't see your issue outlined below? Make sure to check\nout the [main Firebase FAQ](/support/faq) for more pan-Firebase or\nproduct-specific FAQ.\n\nYou can also check out the\n[Firebase Apple platforms SDK GitHub repo](https://github.com/firebase/firebase-ios-sdk/issues)\nfor an up-to-date list of reported issues and troubleshooting. We encourage you\nto file your own Firebase Apple platforms SDK related issues there, too! \n\nWhat versions of Xcode does Firebase support?\n\nFirebase supports up to two major versions of Xcode, not including versions\nof Xcode that Apple no longer supports. For example, starting in March 2019,\nApple required at least iOS 12 on all apps, meaning Xcode 9 support was\ndropped and Xcode 10 was the only major version supported.\n\nChanges to support for specific minor or patch versions of Xcode\n(for example, 9.2.0 to 9.4.1) are determined based on the needs of the\nFirebase Apple platforms SDK and a survey of developer usage. These changes\nare reflected in the\n[Firebase Apple platforms SDK release notes](/support/release-notes/ios)\nand on the [Firebase Apple platforms SDK setup page](/docs/ios/setup).\n\nTo see the minimum Xcode version supported by the SDK, check\nthe requirements listed in\n[Add Firebase to your Apple project](/docs/ios/setup).\n\nFirebase support for Beta releases of Xcode is available on a \"best effort\"\nbasis. Developers can track and submit issues in the\n[Firebase Apple platforms SDK repository on GitHub](//github.com/firebase/firebase-ios-sdk/issues). \n\nMy app prompts the user for their password to access Keychain items on macOS. How do I fix this?\n\nUpgrade your Firebase dependency to version 9.6.0 or higher and add the\n\\[Keychain Sharing capability\\](/docs/ios/troubleshooting-faq#macos-keychain-sharing)\nto your target. \n\nWhy does Firebase require the Keychain Sharing capability on macOS?\n\nFirebase SDKs use keychain to store information like the Firebase\ninstallation ID used for FCM. Without Keychain access, Firebase SDKs may not\nfunction correctly. The macOS keychain behaves differently than the iOS-style\nkeychain that is used on other platforms (iOS, tvOS, macCatalyst,\nand watchOS).\n\nOn macOS, apps use a shared keychain that may be modified by other apps and\nprocesses. Unlike iOS, there is no sandboxed keychain that the app has\nimplicit access to. So, when a Mac app interacts with the keychain, the system\nprompts the user for access since the Mac app may be modifying a keychain item\nthat it did not create. To address this discrepancy, Firebase queries the\nkeychain with the `kSecUseDataProtectionKeychain` key, which tells\nthe app to query a keychain item that is part of a keychain access group\n(this is default behavior on other platforms). The Keychain Sharing capability\nis required because the app needs it to synthesize an access group that can be\nshared amongst its targets, thus giving permission for the app to freely\naccess keychain items in the access group.\n\nFor more information, see Apple's\n[Keychain documentation](https://developer.apple.com/documentation/security/keychain_services/keychains). \n\nIn Xcode versions 13 and later, why can my UIKit apps not open some\nURLs I've registered\nin my Info.plist?\n\nApple introduced a limit of 50 `LSApplicationQueriesSchemes`\nentries in `Info.plist` files. In 2015, Apple introduced\n`LSApplicationQueriesSchemes` to limit the number of URL queries\neach app could make. With the release of Xcode 13, these limits are enforced,\nwhile in Xcode 12 and earlier there was no effective limit to the number of\nschemes.\n\nSome Firebase products, like Firebase Authentication and Firebase Dynamic Links,\nrequire the use of custom URL schemes to redirect to your application. These\nURLs conform to a concise and consistent URL scheme that should not count\nsignificantly against the 50 link scheme limit.\n\nNote that for apps that continue to register more than 50\n`LSApplicationQueriesSchemes`, some schemes will\nbe silently ignored. The app may be unable to execute certain deeplinks,\ndepending on the order in which they are added."]]