iman abumazen
iman abumazen

Reputation: 61

no valid 'aps-environment' entitlement string found for application in Notifications app

I want to use notifications in my iOS app I read many tutorials and I used this one : http://www.raywenderlich.com/32960/apple-push-notification-services-in-ios-6-tutorial-part-1

And my code is :

var types: UIUserNotificationType = UIUserNotificationType.Badge |
        UIUserNotificationType.Alert |
        UIUserNotificationType.Sound
    var settings: UIUserNotificationSettings = UIUserNotificationSettings( forTypes: types, categories: nil )

    application.registerUserNotificationSettings( settings )
    application.registerForRemoteNotifications()

And I received this error: no valid 'aps-environment' entitlement string found for application

I searched a lot and I used all possible solutions and I retried again but nothing changed!!

Upvotes: 3

Views: 2712

Answers (3)

DipakSonara
DipakSonara

Reputation: 2596

I have faced this issue in Xcode 8. You must have to enable Target—> capabilities—> push notification. Check the screenshot.enter image description here

Upvotes: 8

Glorfindel
Glorfindel

Reputation: 22631

The message tells you that push notifications are not enabled for the provisioning profile used to sign your application. You are probably signing it with the default Xcode development profile.

In the tutorial (which is quite a good one, I used it too for my first push notifications), pay attention to the Making the Provisioning Profile section, and make sure that this particular provisioning profile is used during the build (you can change this in the Project Settings).

Upvotes: 2

Subbu
Subbu

Reputation: 2148

I think 'aps-environment' would be in the provisioning profiles.. I'd check if "push notifications" are enabled the provisioning profiles..

Upvotes: 0

Related Questions