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"