App rejected because of "Missing Push Notification Entitlement"
Asked Answered
L

10

37

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 have provided:

Missing Push Notification Entitlement - Your app registers with the Apple Push Notification Service, but the application signature's entitlements do not include the required "aps-environment" entitlement. Make sure you have enabled Push Notification Services for this app, and that you have downloaded a Distribution provisioning profile that includes the "aps-environment" entitlement.

Earlier versions of my app used to have push notifications, and my app binary never got rejected due to that. What should I do here?

Led answered 19/4, 2011 at 15:55 Comment(0)
M
20

Open your Provisioning Profile in any Text Editor and search for "environment".

You should find: aps-environment

If you don't see aps-environment in your provisioning profile, there is an issue in your Apple provisioning certificate.

If you created a certificate without push notifications, and then later on you added Push Notification service, Apple DOESN'T update your provisioning profile.

You need to create a NEW provisioning profile. Sign the binary with this new Provisioning Profile and you would be good to go.

Mongoloid answered 11/2, 2013 at 11:57 Comment(1)
This answer helped me a lotSecretion
L
14

I have recreated my Distribution provisioning profile and build my application with it. This change fixed the issue of Missing Push Notification Entitlements.

Led answered 19/4, 2011 at 16:22 Comment(0)
L
13

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 ;-)

Luttrell answered 14/12, 2014 at 11:34 Comment(2)
This is still needed for Cordova 4.3.0, however they added a DISABLE_PUSH_NOTIFICATIONS macro to disable the code in one place. Now simply add #define DISABLE_PUSH_NOTIFICATIONS in the head of AppDelegate.m and you're good to go.Luttrell
Also for cordova 5.x this is needed. #define DISABLE_PUSH_NOTIFICATIONS solved it. It seems to depends on the plugins you installed. in my case a IAP plugin produce this error.Ruthy
D
8

I had the same problem and I fixed it by recreating the provisioning profile. From "Provisioning and Development" in the Local and Push Notification Guide:

The Team Admin or Team Agent must next create the provisioning profile (Development or Distribution) used in the server side of remote-notification development. The provisioning profile is a collection of assets that associates developers of an application and their devices with an authorized development team and enables those devices to be used for testing. The profile contains certificates, device identifiers, the application’s bundle ID, and all entitlements, including . All team members must install the provisioning profile on the devices on which they will run and test application code.

Dewan answered 1/10, 2012 at 15:18 Comment(1)
Works for me too, I've enabled APNS for my AppID after I've created the AppStore provisioning profile, so it seemed that the APNS entitlements were not included in the profile, therefore you've to recreate it.Trichology
S
4

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

Screenshot while validating the archive

Spohr answered 27/1, 2015 at 15:16 Comment(2)
In my case, Xcode is using its own default provisioning profile. what should I do so Xcode use My app provisioning profileEnroll
- Did you try mentioning your provision profile in Build Settings->Code Sigining. - Even after asking to use your prov profile, if Xcode uses default prov profile, delete the default prov profile in member centreSpohr
B
3

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.

Braeunig answered 20/4, 2011 at 4:54 Comment(1)
Thanks for this. After a whole day of puzzling over this, I found your answer here and commented out [[UIApplication sharedApplication] registerForRemoteNotificationTypes: (UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert)]; in appDelegate, which seems to have solved it.Cist
V
3

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:

  1. rebuilt your project in XCode, or
  2. moved to another computer and forgot to tell XCode what the correct profile was, or
  3. somebody sat on your computer and changed it, or

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):

enter image description here

Hope this helps other people out there in same situation.

Vespine answered 4/8, 2015 at 2:59 Comment(0)
L
1

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.

Leonor answered 7/11, 2014 at 19:10 Comment(0)
P
0

I have same problem. I have solved it.

I think this problem causes when adding push-notification-function into AppID and no recreating Provisioning. We will receive a warning when adding iCloud-function:

All new provisioning profiles you create for this App ID will be enabled for iCloud. If you wish to enable iCloud for any existing provisioning profiles associated with this App ID, you must manually regenerate them

I think when we add some function in AppID, we should manually regenerate all provisionings which are related to that AppID.

I think so

Philosophism answered 20/2, 2013 at 3:9 Comment(0)
M
0

Steps

  1. Enable Push Notification Service (Production Push SSL Certificate)

  2. Create/Recreate Distribution Provisioning Profile and build your application with updated Distribution Provisioning Profile.

The following resources may help you

Miscall answered 4/4, 2013 at 2:29 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.