0

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

Vivin K
  • 2,681
  • 1
  • 11
  • 14
Manutur
  • 3
  • 3

3 Answers3

0

There are two types of modes that you have to taken care of: Production and Distribution. Set it accordingly.

BTW try it: Go to Xcode "Preferences"

Select tab named "Accounts"

Select Apple ID and click "View Details"

Click on the arrow on the bottom left corner to refresh

Click "Done"

And try again !

For more details follow link.

Community
  • 1
  • 1
ankit
  • 3,537
  • 1
  • 16
  • 32
0

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.

Vittal Pai
  • 3,317
  • 25
  • 36
  • yes, i try and solve the problem, the first one is create provisioning profile as iOS Distribution (before:iOS Development) , second: add aps-environment : production in entitlements. Thanks Vittal Pai – Manutur Apr 28 '17 at 04:39
0

I had a same issue after publishing to test flight. I tried lot of time. later, i recreated distribution profile and signing with new distribution profile solve that issue. Now, I am able to register my device to push notification.

Narendra
  • 1,332
  • 2
  • 13
  • 16