I assume that you are running / debugging on the device, since you will get another error trying to register for the token token from the simulator. Just wanted to get it out of the way.
This usually causes the error that you see, so that Push Notifications are not included in the selected Provisioning Profile. Now you may have logged into the IOS Provisioning Portal and enabled Push for your application ID (also note if you enabled Push for your development or distribution profile). However, after that you need to log in and “pollute” your Provisioning profile for the Provisioning Portal in order to create a new Provisioning Profile that has rights to it.
By "dirty", this means switching and changing some profile settings to force a re-creation. You will find out if you just need to “pollute” if, having returned to the list of Provisioning Profiles, the status temporarily changes to “Waiting” for a few seconds before becoming “Active” again and allowing it to be downloaded.
Oh, and I just found this, which also answers the question (someone will help if I connected it incorrectly): Package ID and click certificate ... aps-environment
source share