Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Apple push notification not working

 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
}
like image 318
bhavya kothari Avatar asked Dec 05 '25 16:12

bhavya kothari


1 Answers

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.

like image 129
PassKit Avatar answered Dec 08 '25 07:12

PassKit



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!