Recently my application got rejected while uploading it. The Apple review team says my app is \"Missing Push Notification Entitlements\"
This is the information they
My Case : I have implemented push notifications for an update to my appstore app. As the provisioning profiles prior to the push notification impelmentation becomes invalid, I have created new Appstore-distribution provisioning profile and built the app with new profile and uploaded to store. But I got a mail saying "Missing Push Notification Entitlement".
Finding : I found that while archiving, Xcode is using the wrong (invalid/old) provisioning profile. So deleted the old provisioning profile from member centre and it solved the problem
I received this same error message, and recreating my provisioning profile didn't eliminate it.
Instead I found that my app contained some stray APNS-related symbols (in a library) that weren't being used. Apparently they caused a static analyzer to mark the app as using push notifications (it doesn't). #ifdef-ing out the symbols allowed my app to be accepted without the aps-environment entitlement.
If you are submitting a Cordova / Phonegap project and you are NOT using push notifications, you should inspect Classes/AppDelegate.m
for the two methods below. Observed in Cordova 3.7.0, not sure about other versions.
Make sure you are not using remote notifications in any other way (carefully check your plugins as well). Then remove or comment out the following block:
- (void) application:(UIApplication*)application
didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken
{
// re-post ( broadcast )
NSString* token = [[[[deviceToken description]
stringByReplacingOccurrencesOfString:@"<" withString:@""]
stringByReplacingOccurrencesOfString:@">" withString:@""]
stringByReplacingOccurrencesOfString:@" " withString:@""];
[[NSNotificationCenter defaultCenter] postNotificationName:CDVRemoteNotification object:token];
}
- (void) application:(UIApplication*)application
didFailToRegisterForRemoteNotificationsWithError:(NSError*)error
{
// re-post ( broadcast )
[[NSNotificationCenter defaultCenter] postNotificationName:CDVRemoteNotificationError object:error];
}
Hope this saves you a few hours ;-)
I recently encountered this issue after adding a Today Extension to an app with Push Services enabled. Finally realized that the Mobile Provisioning profile generated by Xcode for the Today Extension did not have Push Notifications Services enabled. Once I enabled Push Services for the Today Extension, the warning from Apple went away.
I have recreated my Distribution provisioning profile and build my application with it. This change fixed the issue of Missing Push Notification Entitlements.
I also had this problem with a Cordova app and after doing a bit of reading it seems that this is a common issue nowadays.
WHY DID IT HAPPEN?
Since you mention that your app was already approved using push notifications, the most likely scenario is that the Provisioning Profile for your app was changed when submitting it to the AppStore. Perhaps you:
This issue happens because permissions are gleaned through the provisioning profile. If you forget to link the provisioning profile for your app to an AppID that has the 'Push Notifications' entitlement (Note that XCode does this automatically by using the wildcard developer provisioning certificate by default) then you are likely to get this message until you sort out the permissioning.
HOW TO REMOVE THE NEED FOR PUSH NOTIFICATIONS IN CORDOVA APPS:
I was submitting a Cordova app when I got this message, and while the solution posted by @jlapoutre is enough to get your app approved, you want to continue benefiting from Cordova upgrades so the best thing is to take advantage of conditional compilation (ie triggering the #ifndef DISABLE_PUSH_NOTIFICATIONS
directive which tells XCode to compile you app with this bit of code left out).
Conditional compilation is also known as 'Preprocessor Macros' in XCode-speak. This is how the you can accomplish this graphically via the UI (note that this the way its done in XCode 6.1):
Hope this helps other people out there in same situation.