3
votes
 NSLog(@"push notification in process");
 [[UIApplication sharedApplication]registerForRemoteNotificationTypes:(UIRemoteNotificationTypeBadge|UIRemoteNotificationTypeSound|UIRemoteNotificationTypeAlert)];


Entering above code in appdelegate.m file in didFinishLaunchingWithOptions: method

I am getting error message as follows:

Error :


Failed to get token, error: Error Domain=NSCocoaErrorDomain Code=3000 "no valid 'aps-environment' entitlement string found for application" UserInfo=0x20021380 
{
NSLocalizedDescription=no valid 'aps-environment' entitlement string found for application
}
1
I want to implement push notification to my app can you help me?vivek bhoraniya
@vivek There lot of help available on stackoverflow and googlebhavya kothari
I searched on net about this but I didnt get how to use backend for thisvivek bhoraniya
what things require from backend? means how to setup backend for thatvivek bhoraniya
@vivek - I dont know about how it works on backend - I assume it will be PHP web backend and there will be an UI through which admin can send Push Notification to iphone - and i have implemented code on iphone side onlybhavya kothari

1 Answers

3
votes

This could be due to a number of issues. See if any of the following fix it:

  • check your AppID has been enabled for push notifications in the provisioning portal
  • check your profile for the string: aps-environment
  • check that you are using a named profile (not a wildcard)
  • check that the capitalisation on your certificate matches your product name (they are case sensitive)

If these fail then the issue could be due to the provisioning profile in Xcode. If you created your provisioning profile before configuring the AppID for push, try regenerating and installing a new profile.