While running my application via Xcode to my iPhone I noticed I was getting the following error in the log:
no valid “aps-environment” entitlement string found for application" UserInfo={NSLocalizedDescription=no valid “aps-environment” entitlement string found for application}
I was able to fix this problem by enabling push notification capability.
Click on .xcodeproj -> Capabilities -> Enable Push Notification.