If you get the following error when trying to register for a device token, firstly ensure you have correctly followed the directions within the iPhone Developers Portal.
Error Domain=NSCocoaErrorDomain "no valid 'aps-environment' entitlement string found for application"
If after you have verified your Provisioning Profile and application settings you still get the error, try the following:
Go to the Project Settings in the Project Menu
Select the exact Code Signing identity for your application rather then the automatic selection.