Search code examples
iosxcodeapple-push-notificationsprovisioning-profile

Failed registering for push notifications iOS


I want add push notification for iOS app. I'm using this tutorial

When run from xcode to Device (direct). Its success But, when I upload to testFlight. I get an error.

Failed registering for push notifications.The application will not be able to receive notifications.Error in registration for Push notification,check your provisioning profile.Original error:no valid 'aps-environment' entitlement string found for application


Solution

  • It seems to be your Provisioning profile/entitlements file doesn't contains aps-environment key.

    Delete the existing provisioning profile from your xcode and re-download it from your appledeveloper account and make sure you have aps-environment key pair in your app's .entitlements file before uploading to test flight.