关于 Apple 平台和 Firebase 的问题排查及常见问题解答
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
本页针对在 Apple 平台上使用 Firebase 时可能会遇到的特有问题,提供了技巧建议和问题排查方法。
还有其他难题,或是您的问题未在下面列出?请查看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 个链接架构这一限制有显著影响。
请注意,如果应用累计注册的 LSApplicationQueriesSchemes
超过 50 个,某些架构将被静默忽略;这会使得应用可能无法执行某些深层链接,具体取决于这些链接的添加顺序。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-16。
[null,null,["最后更新时间 (UTC):2025-08-16。"],[],[],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."]]