疑難排解與疑難排解;Apple 平台和 Firebase 常見問題
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
本頁面提供提示和疑難排解資訊,協助您解決使用 Firebase 時可能遇到的 Apple 平台專屬問題。
遇到其他問題,或找不到下方列出的問題嗎?如要查看更多 Firebase 相關或產品專屬的常見問題,請務必參閱主要 Firebase 常見問題。
如需最新回報問題清單和疑難排解資訊,請參閱 Firebase Apple 平台 SDK GitHub 存放區。我們也鼓勵您在該處回報 Firebase Apple 平台 SDK 的相關問題!
我的應用程式會提示使用者輸入密碼,以便存取 macOS 上的鑰匙圈項目。如何修正這個問題?
將 Firebase 依附元件升級至 9.6.0 以上版本,並將 [鑰匙圈分享功能](/docs/ios/troubleshooting-faq#macos-keychain-sharing)新增至目標。
為什麼 Firebase 需要 macOS 的「鑰匙圈共享」功能?
Firebase SDK 會使用鑰匙圈儲存資訊,例如用於 FCM 的 Firebase 安裝 ID。如果無法存取鑰匙圈,Firebase SDK 可能無法正常運作。macOS 鑰匙圈的運作方式與其他平台 (iOS、tvOS、macCatalyst 和 watchOS) 使用的 iOS 樣式鑰匙圈不同。
在 macOS 上,應用程式會使用共用鑰匙圈,但其他應用程式和程序可能會修改這個鑰匙圈。與 iOS 不同,應用程式無法隱含存取沙箱化的鑰匙圈。因此,當 Mac 應用程式與鑰匙圈互動時,系統會提示使用者授予存取權,因為 Mac 應用程式可能會修改並非由該應用程式建立的鑰匙圈項目。為解決這項差異,Firebase 會使用 kSecUseDataProtectionKeychain
金鑰查詢鑰匙圈,指示應用程式查詢屬於鑰匙圈存取群組的鑰匙圈項目 (這是其他平台上的預設行為)。應用程式需要「鑰匙圈共享」功能來合成可在目標之間共用的存取群組,因此必須具備這項功能,應用程式才能自由存取存取群組中的鑰匙圈項目。
詳情請參閱 Apple 的
「鑰匙圈」說明文件
。
在 Xcode 13 以上版本中,為什麼我的 UIKit 應用程式無法開啟我在 Info.plist 中註冊的部分網址?
Apple 在 Info.plist
檔案中導入 50 個 LSApplicationQueriesSchemes
項目上限。2015 年,Apple 推出 LSApplicationQueriesSchemes
,限制每個應用程式可發出的網址查詢次數。Xcode 13 發布後,系統會強制執行這些限制,而 Xcode 12 和更早版本則沒有有效的架構數量限制。
部分 Firebase 產品 (例如 Firebase Authentication 和 Firebase Dynamic Links) 需要使用自訂網址通訊協定,才能重新導向至您的應用程式。這些網址符合簡潔一致的網址配置,不應大幅計入 50 個連結配置的限制。
請注意,如果應用程式持續註冊超過 50 個 LSApplicationQueriesSchemes
,系統會自動忽略部分配置。視深層連結的加入順序而定,應用程式可能無法執行特定深層連結。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-08-29 (世界標準時間)。
[null,null,["上次更新時間:2025-08-29 (世界標準時間)。"],[],[],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."]]