You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Xcode 12推送通知开关为空、12.1添加能力按钮异常求助

Fixes for Push Notification Issues in Xcode 12 & 12.1

Hey there, I’ve run into both of these exact issues with Xcode 12 and 12.1 before—super frustrating, right? Let me share the fixes that worked for me and other fellow developers:

Issue 1: Empty Push Notification Toggle in Xcode 12

Here’s what resolved this for me:

  • First, double-check that your Apple Developer account has Push Notification permissions enabled, and your project’s Bundle ID has the Push Notifications service turned on in the Apple Developer后台
  • Clean your project and build folder: use Cmd + Shift + K to clean the project, then Cmd + Option + Shift + K to wipe the build folder
  • Quit Xcode entirely, restart your Mac, then reopen the project and check the Capabilities tab again
  • If the toggle is still empty, manually edit your project’s .entitlements file: add the aps-environment key, and set its value to development (for testing) or production (for release builds)

Issue 2: Hidden Push Notification Button & Disabled Capability in Xcode 12.1

This is likely a Xcode bug or signing configuration conflict—try these steps:

  • Make sure you’ve selected the correct development team in the Signing & Capabilities tab of your project target. If no team is selected, pick your team first before adding capabilities
  • Try manually adding the capability: Right-click your .xcodeproj file, select "Show Package Contents", open the project.pbxproj file with a text editor, and search for com.apple.PushNotification. If it’s missing, add it to the relevant Capabilities section of your target
  • Delete your project’s Derived Data folder (located at ~/Library/Developer/Xcode/DerivedData/), quit Xcode, then reopen and try adding the Push Notification capability again
  • If the capability remains disabled after adding, head to the Apple Developer backend to confirm Push Notifications is enabled for your Bundle ID. Then download the latest Provisioning Profile and import it into Xcode, or let Xcode automatically manage signing to refresh the profile

Hope these solutions get your push notifications working smoothly again!

内容的提问来源于stack exchange,提问作者Kefah.b

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.09 19:47:44