When I run my FlutterFlow iOS build (TestFlight), the app consistently fails to register for APNs.
The error from didFailToRegisterForRemoteNotificationsWithError is:
Error Domain=NSCocoaErrorDomain Code=3000
"application does not have a valid 'aps-environment' entitlement"
UserInfo={NSLocalizedDescription=application does not have a valid 'aps-environment' entitlement}My App ID on Apple Developer has Push Notifications enabled.
Provisioning profiles also contain
aps-environment.Runner.entitlementsinside the exported project is correct.
However, in the generated Xcode project (project.pbxproj) the CODE_SIGN_ENTITLEMENTS setting is completely missing for the Runner target. Because of this, the entitlements file is not actually included in the final IPA signature, so APNs registration fails. (At least I think so)
I also tried building locally with Xcode, and when inspecting the IPA with codesign --entitlements, the aps-environment key is missing, confirming that the entitlement was stripped.
As a result, I cannot obtain an APNs token and the app always throws the NSCocoaErrorDomain 3000 error.