Why "add Push notification feature to your app id" warning even after push-notification showing enabled in App ID?
Asked Answered
R

11

51

I am using Xcode8, swift 3, iOS 10

In Targets -> capabilities showing "add the Push notification feature to your app id".

I check my APP ID and it is showing pushnotfication enabled in both development and distribution.

With same APP IS and certificate I am getting notification in iOS9 but in iOS 10 i am getting error

Error Domain=NSCocoaErrorDomain Code=3000 "no valid 'aps-environment' entitlement string found for application" UserInfo={NSLocalizedDescription=no valid 'aps-environment' entitlement string found for application}  

and also showing red mark (issue)

Religionism answered 9/11, 2016 at 10:53 Comment(1)
@Anbu suggested answer is not according to question asked, my question is for Xcode8 and swift 3 testing on iOS10Religionism
S
119

I restarted XCode and it was gone :-)

Sectarian answered 18/11, 2016 at 7:11 Comment(5)
LoL... And yeah sadly, this is the correct answer. Probably a Clean would work too.Margartmargate
I am singing 'sad but true' \m/Vivianaviviane
I did clean>>build>>restarted XCode and it was gone.Croup
This is hilarious :)Burnard
After spending several hours revoking and recreating provisioning profiles on developer.apple.com, this worked. FU xcodeSapper
A
14

Close Xcode -> reopen -> clean -> build -> run.

Fixed the issue for me. Xcode 9.0.

Arlin answered 28/9, 2017 at 15:14 Comment(0)
F
11

Sadly I quit xcode then installed the .mobileprovision (double clicking it) then restarted xcode and the warning was gone...Followed the other answer here by SteMa

Frisian answered 20/1, 2017 at 19:36 Comment(2)
In what way is that an answer to the question?Apodal
Quitting Xcode and installing .mobileprovision, then restarting Xcode will solve the problem.Frisian
J
8

This happened to me. For some reason xCode signed me out. The fix: Tap Xcode (top bar) -> select Preferences -> select your Apple Id -> Sign-in. Hope this helps someone!

Jacklin answered 29/5, 2017 at 0:46 Comment(0)
L
7

In my case it does not help restarting xcode again.

I just restart system and that problem was gone.

Linseed answered 18/4, 2017 at 4:19 Comment(1)
Yup, for those of who restarted XCode and still didnt get it fixed, restarting the pc works.Tennietenniel
L
5

After I enabled push for my app, I had to regenerate my provisioning profiles and re-download them for Xcode to recognized the aps attribute.

Leanoraleant answered 16/1, 2017 at 15:3 Comment(2)
Can you please provide an example for what you did? From where would I regenerate my provisioning profiles and from where to re-dowload them and where to put them after download? I'm very new to xCode.Connected
@Ionut you have to regenerate the provisioning profile in the developer.apple.com/account/ios/profile/production of your account after you enable push for your app. You then re-download the profile and add it to Xcode in your app signing section.Disharmony
S
3

In my situation I went to here enter image description here & here enter image description here

under the general tab in xCode settings and reset my bundle identifier to a different name and it fixed the certificates and everything worked!

Obviously if you need the same bundle identifier you will need to go with some of the other suggestions here, but use this if all else fails.

Searles answered 25/2, 2017 at 0:29 Comment(0)
W
2

In my case, none of the above answers worked. I had to generate new certificates. Xcode >> Preferences... >> Accounts >> select team >> Manage Certificates... >> + >> iOS Development >> repeat + >> iOS App Store.

Widely answered 18/8, 2017 at 18:55 Comment(0)
H
0

IF you have enabled Push notification ,your old Provisioning profile become inactive . Edit that old Provisioning profile and download fresh one , then try to generate the build .

Hydatid answered 19/5, 2017 at 13:44 Comment(0)
W
0

Check Info.plist -> Bundle identifier and establish it as YourProject -> Targets -> General -> Bundle identifier. Work for me

Walkerwalkietalkie answered 29/8, 2018 at 7:54 Comment(0)
E
0

Change your developer account in Xcode, because of APNS certificates developer account and Xcode developer account must be same.

--> Go to Target

--> Go to General Tab

--> GO to Signing

--> Select Team, Which account you used to develop APNS certificates.

Engrail answered 21/1, 2019 at 12:53 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.