There is no valid aps-environment permission string for the app in the Notifications app
I want to use notifications in my iOS app I read a lot of tutorials and I used this: http://www.raywenderlich.com/32960/apple-push-notification-services-in-ios-6-tutorial-part-1
And my code:
var types: UIUserNotificationType = UIUserNotificationType.Badge |
UIUserNotificationType.Alert |
UIUserNotificationType.Sound
var settings: UIUserNotificationSettings = UIUserNotificationSettings( forTypes: types, categories: nil )
application.registerUserNotificationSettings( settings )
application.registerForRemoteNotifications()
And I got this error: There is no valid aps-environment permission string for the application
I searched a lot and I used every possible solution and tried again but nothing changed !!
source to share
The message says push notifications are not enabled for the provisioning profile that is used to sign your app. You are probably signing it with the default Xcode development profile.
In the tutorial (it's pretty good, I used it for my first push notifications as well), take a look at the Create a Provisioning Profile section and make sure this profile is used at build time (you can change this in your project settings).
source to share