aps-environment: Fixing the Push Entitlement
The aps-environment entitlement is the key in your app’s code signature that tells iOS which Apple push server to register with, and it has only two values: development for the sandbox and production for live builds. When it’s missing or wrong, the app still launches, but it can’t get a device token, Xcode refuses to sign it, or App Store Connect sends an ITMS-90078 warning. The fix is to read the value inside the actual build, then make the entitlements file, the provisioning profile and the push server agree.

Search for this key and you mostly land on old Stack Overflow threads and Apple forum posts, each solving one symptom for one person. Apple’s own reference page is four short paragraphs. None of them compares the three errors or shows how to check a shipped build, which is what you need when the app came from another developer and nobody remembers how push was set up. Below are Apple’s documented rules, the failures developers report on the forums, and the order we check things in when push breaks on an app we’ve just taken over.
What is the aps-environment entitlement?
It’s a code-signing entitlement that decides whether your app registers with the development or the production instance of the Apple Push Notification service, usually shortened to APNs. Apple’s reference describes it as the environment for push notifications, with development and production as the only accepted values, and notes that the development environment is also called the sandbox.
An entitlement is a permission baked into the app’s signature when it’s built. iOS reads it at runtime, and the App Store checks it at upload. You don’t set aps-environment in code, and changing a value in your Swift or Kotlin files won’t touch it. It lives in the target’s .entitlements file, and Xcode adds it when you turn on the Push Notifications capability.
Apple also says the same entitlement covers both the UserNotifications framework, which handles normal alerts and badges, and PushKit, which VoIP calling apps use to wake up for incoming calls. macOS apps use a sibling key, com.apple.developer.aps-environment, which works the same way.
Each value maps to a server, and Apple’s guide to sending notifications lists api.sandbox.push.apple.com as the development server and api.push.apple.com as the production server, and says to use production for shipping apps and development for testing. A build signed with development produces device tokens that only the sandbox server accepts, and a build signed with production produces tokens that only the production server accepts. Most push bugs on inherited apps come from one side of that pair drifting away from the other.
Where does the value come from: the entitlements file or the profile?
Both set it, with different jobs: the entitlements file says what the app claims, and the provisioning profile says what the app is allowed to claim. Apple’s technote TN3125 on provisioning profiles says that the entitlements in a profile act as an allowlist, every entitlement the app claims must appear in that allowlist, and the reverse isn’t required.
So a profile can include aps-environment while the app doesn’t claim it, and nothing complains until the app tries to register for push. The opposite case, where the app claims it and the profile doesn’t allow it, fails at signing time.
Apple’s entitlement reference says Xcode sets the value from the current provisioning profile, so a development profile gives you development and a distribution profile gives you production. Answers on Apple’s developer forums add one useful detail: since Xcode 8, Xcode doesn’t copy aps-environment from the profile into the app on its own. If the key isn’t in the target’s entitlements file, a perfectly good profile with push enabled won’t save you, and the signed app ends up without it.
On an inherited app it usually looks like this: the App ID in the developer account has push turned on, the profiles were regenerated last year, and the server is sending notifications, but someone deleted the capability from the target during a cleanup, or a new extension target was added without it, and nobody tested push on a fresh install.
What do the three aps-environment errors mean?
Each error tells you which stage of the build failed and where to look before you change anything.
| Error | Where you see it | What’s missing | First fix |
|---|---|---|---|
| no valid ‘aps-environment’ entitlement string found for application | Device log, when the app asks for a push token | The signed app doesn’t claim the entitlement | Add the Push Notifications capability to the target |
| Provisioning profile doesn’t include the aps-environment entitlement | Xcode or your CI during signing | The profile doesn’t allow push | Enable push on the App ID and regenerate the profile |
| ITMS-90078: Missing Push Notification Entitlement | Email from App Store Connect after upload | The app registers for push but its signature lacks the key | Find the code that registers, then add the key or remove the call |
The runtime error is easy to miss because the app keeps working. Apple’s registration guide says registration can fail if the device has no network, if the APNs server is unreachable, or if the app doesn’t have the proper code-signing entitlement, and it tells you to handle the failure in didFailToRegisterForRemoteNotificationsWithError. Many older apps leave that method empty or log to nowhere, so the only visible effect is that some users never get notifications and the backend has no token for them.
The signing error stops the build, and it’s the easiest to fix because the cause is always in the developer account. The App ID has to have the push service enabled, and the profile has to be created after that change. A profile generated before you ticked the box stays without push until you edit or regenerate it, which is the same trap our article on a provisioning profile that doesn’t include the signing certificate walks through for certificates.
Apple’s ITMS-90078 warning says the app appears to register with the push service while the signature lacks the entitlement. It often reaches teams who believe their app has no push at all, and the forum threads show why: a dependency, often an analytics SDK or a cross-platform plugin, is calling the registration API on its behalf.
How do you check which value a build actually has?
Read the entitlements from the signed app itself rather than from the project settings, because build settings, export options and CI can all change what ends up in the signature. TN3125 gives the command for the app’s claimed entitlements, and the profile can be unpacked with the security tool from the same technote.

Start with the archive or IPA you actually uploaded. An IPA is a zip file, so unzip it and look inside the Payload folder for the .app bundle. Then dump what the binary claims:
codesign --display --entitlements - --xml Payload/YourApp.app | plutil -convert xml1 -o - -
You’re looking for a key named aps-environment and the string under it. If the key isn’t there, the app will never get a device token, whatever the profile says. If it says development on a build you sent to TestFlight, something in the export step went wrong, because App Store distribution signs for production.
Then check the profile that was embedded in the same bundle:
security cms -D -i Payload/YourApp.app/embedded.mobileprovision -o profile.plist
plutil -extract Entitlements xml1 -o - profile.plist
The profile’s Entitlements dictionary should list aps-environment too. If the app claims it and the profile doesn’t, you’ll hit the signing error on the next build. If the profile allows it and the app doesn’t claim it, you’ve found the Xcode 8 behavior from the previous section.
Do the same for every extension in the PlugIns folder that touches notifications. A notification service extension, which edits a push before it’s shown, is signed separately with its own profile and entitlements. One of the forum threads on ITMS-90078 traced the warning to a WidgetKit extension, not the main app.
How do you add aps-environment correctly in Xcode?
Turn on the Push Notifications capability for the target, confirm push is enabled on the App ID in your developer account, and then make sure the profile you sign with was generated after that. Apple’s registration guide lists those two steps, the capability in Xcode and the push service on the App ID, as the setup for push.

In Xcode, select the app target, open Signing & Capabilities, and add Push Notifications if it isn’t listed. Xcode writes aps-environment into the target’s .entitlements file and points the build setting CODE_SIGN_ENTITLEMENTS at that file. Open the file afterwards and confirm the key is really there, because a project that was converted from another tool or merged by hand sometimes has two entitlements files and the build only reads one of them.
If the project uses automatic signing, Xcode updates the App ID and the development profile for you, as long as the account it’s signed into has the right role. With manual signing, go to Certificates, Identifiers and Profiles in the developer account, open the App ID, enable Push Notifications, save, and then regenerate both the development and distribution profiles. Download the new ones and select them in Xcode or in your CI configuration, since the old files on disk stay stale.
In most cases you should leave the value alone, because Apple’s reference says the defaults can be modified but Xcode already picks development for a development profile and production for distribution, and hand-editing it usually creates the mismatch you’re trying to fix. The one exception teams reach for is testing production push from a debug build, and a TestFlight build does that job with less risk.
Once push is configured, look at the registration code. The app should call registerForRemoteNotifications() on every launch and send the fresh token to your server, and Apple says not to cache device tokens locally, because the system issues a new one after a restore from backup, an install on a new device or an operating system reinstall. On an inherited app, that cached token is a common reason why a handful of users never receive anything even after the entitlement is fixed.
Why do pushes still fail when aps-environment looks right?
The usual reason is a mismatch between the environment the build registered with and the server your backend sends to. A correct entitlement gets the device a token, but your backend still has to send that token to the matching server.
Apple’s response reference describes BadDeviceToken as an invalid token and tells you to check that the token matches the environment. That’s exactly what happens when a developer installs a build from Xcode, which registers with the sandbox, and the backend sends to api.push.apple.com. It also happens the other way round, when a TestFlight tester’s production token is sent to the sandbox host by a staging server that someone pointed at real users.
Look at how your backend decides which host to call. Providers store the environment per app, per token, or behind a config flag that nobody has changed in years. If your staff test on Xcode builds while customers run App Store builds, the server needs to know which environment each token came from, or one group will always miss out. Apple also says not to retry requests that fail with BadDeviceToken, so a server that keeps resending makes the problem worse and gets its connection dropped sooner.
There’s a separate class of failure on the sending side: an expired certificate, a revoked key or a token that fails authentication. Those leave the device side perfectly healthy, and our guide to an expired APNs certificate covers how to tell them apart by the reason string in Apple’s response.
Why does ITMS-90078 appear on an app with no push feature?
Something in the app is calling the remote notification registration API, and the build doesn’t claim the entitlement that call needs. The warning is triggered by what the binary calls, so a product with no push feature can still get it.

The forum threads point at a handful of repeat causes. A marketing or analytics SDK that offers push as an optional module can register as soon as it’s initialized. A cross-platform plugin added for one feature can bring push registration along with it. A developer can leave a registerForRemoteNotifications() call behind after a push feature was dropped. And local notifications, the reminders an app schedules on the device itself, are sometimes confused with remote ones, though they don’t go through APNs at all.
If the app should support push, add the capability, check the build with the commands above and ship. If it shouldn’t, find the call and remove it, because claiming an entitlement you don’t need adds one more thing to configure on every new profile. Searching the compiled binary and its frameworks for the registration selector usually finds the culprit faster than reading through every dependency’s changelog.
Some forum threads describe the warning persisting after every recommended step, with developers filing feedback reports to Apple. If you’ve confirmed with codesign that the shipped binary claims aps-environment and the warning still arrives, keep the codesign output with the release notes and move on, because that output shows what the binary really claims.
What changes for React Native, Flutter and CI builds?
The rules are the same, but the entitlements file is often generated by a tool you don’t control directly, so the fix lives in that tool’s configuration rather than in Xcode. A hand edit to the generated file usually disappears on the next build.
Expo projects create the native iOS project from app configuration and plugins, so push setup belongs in that configuration. Threads on the Expo forums show builds where the entitlement went missing and one case where a malformed entitlements entry, a key with no value, hid the push capability. Flutter and plain React Native projects keep a normal Xcode project in the ios folder, so the Xcode steps above apply to the Runner target or the app target directly.
CI is where profiles and entitlements drift apart most often. One Apple forum thread describes a Codemagic build with manual signing where the App ID had push enabled and the signed app still had no aps-environment, because the profile and the entitlements file the pipeline used didn’t match what the developer had locally. If your team uses fastlane match or a similar tool to share signing files, regenerate the profiles after enabling push on the App ID, or CI will keep signing with the old ones. Then add the codesign check to the pipeline itself, so a build without the key fails before it’s uploaded.
How do you keep push from breaking on an inherited app?
Write down the full push chain once and check it on every release: the capability on each target, push on the App ID, the profiles that allow it, the value in the signed build, the host your server sends to, and the credential it uses. Each of those links can break on its own, and the symptom is the same silent drop in delivery every time.
When RapidLabs picks up an app through an app takeover, push is one of the first things we trace end to end, because it’s the feature most likely to fail without anyone noticing. The app doesn’t crash, so the first signal is usually a customer asking why they stopped getting order updates. We dump the entitlements from the last shipped build before we change any settings, since the shipped signature is what users are running, whatever the project files say.
A one-line codesign step in CI is cheap enough to run on every build, and failing the build when aps-environment is missing or has the wrong value catches the problem before upload. An alert on the rate of BadDeviceToken responses from APNs catches the environment mismatch on the server side. If the app is also due other signing work, our guide to a lost or expired iOS distribution certificate covers the credentials that sit next to push in the same account.
If push on your app has been unreliable for a while and nobody can say why, the cause is usually wider release debt around signing and the backend, and a stabilization engagement at RapidLabs is built to sort that out.
Frequently asked questions
What are the valid values for aps-environment?
The only values are development and production, and Apple's entitlement reference says development is also called the sandbox environment. Xcode picks the value from the provisioning profile you sign with, so a development profile gives you development and a distribution profile gives you production.
Is aps-environment the same as com.apple.developer.aps-environment?
They do the same job on different platforms. iOS apps use aps-environment, and Apple documents com.apple.developer.aps-environment as the push environment entitlement for macOS apps. Both are added when you enable the Push Notifications capability in Xcode, and both take development or production.
Do I need aps-environment if my app only shows local notifications?
Local notifications scheduled on the device don't go through Apple's push service, so they don't need it. The entitlement matters when the app or one of its libraries calls the remote notification registration API. That call is usually why an app with no push feature still gets the ITMS-90078 warning after upload.
Can I set aps-environment to production in a debug build?
Apple's documentation says the default value can be changed, but the provisioning profile must still allow it, because the profile acts as an allowlist for the entitlements your signed app claims. In practice it's simpler to keep debug builds on development and test production delivery through a TestFlight build.
Why does my TestFlight build stop getting pushes that worked in Xcode?
A build you run from Xcode with a development profile registers with the sandbox push service, while a build uploaded to App Store Connect is signed for production. The device token the app sends to your server changes with it, so a server that still sends to the sandbox host or keeps an old development token will get BadDeviceToken back from Apple.
Does ITMS-90078 block the build from going live?
App Store Connect emails it after upload as a warning, and Apple handles review rejections separately. Treat it as a real defect anyway, because it means either push won't work in that build or some code is asking for push that you didn't know about.
Stuck on a release, a crash, or an app nobody owns?
RapidLabs maintains, stabilizes and takes over existing iOS and Android apps. Send the app link, the stack, and what is going wrong, and you will get a plain answer on whether you need help at all.
Talk to a senior engineer about your app