Excluding Apple Push Notification API from iOS-build

I’m creating a game for iOS, testing it via Apple TestFlight (the new Apple-version of it).

The app doesn’t use Push Notifications.

None the less, I’m getting the following email every time sending out a new build via TestFlight:

iTunes Connect: Your app “” (Apple ID:
) has one or more issues

Dear developer,

We have discovered one or more issues
with your recent delivery for “”. Your
delivery was successful, but you may
wish to correct the following issues
in your next delivery:

Missing Push Notification Entitlement

  • Your app appears to include API used to register with the Apple Push
    Notification service, but the app
    signature’s entitlements do not
    include the “aps-environment”
    entitlement. If your app uses the
    Apple Push Notification service, make
    sure your App ID is enabled for Push
    Notification in the Provisioning
    Portal, and resubmit after signing
    your app with a Distribution
    provisioning profile that includes the
    “aps-environment” entitlement. See
    “Provisioning and Development” in the
    Local and Push Notification
    Programming Guide for more
    information. If your app does not use
    the Apple Push Notification service,
    no action is required. You may remove
    the API from future submissions to
    stop this warning. If you use a
    third-party framework, you may need to
    contact the developer for information
    on removing the API.

After you’ve corrected the issues, you
can use Xcode or Application Loader to
upload a new binary to iTunes Connect.

Regards,

The App Store team

This email goes out to every internal betatester on the entire iTunes Connect account! As we use it for different projects with different people, and to keep business partners updated as well, this is quite disastrous.

So the many post saying “Ignore it” doesn’t apply here.

As I don’t use Push Notifications, is it possible to exclude the Apple Push Notification API when building from Unity? Or comment out the parts of the code containing it after build? An postprocess maybe?

I would like to do something like this: https://unitycodes.wordpress.com/2015/02/06/missing-push-notification-entitlement/ - but I can’t find all of the lines to comment out in the UnityAppController.mm-file… maybe the builder has been updated?

Any help - except “ignore it” :wink: - is most welcome!

This is in case someone is using Unity 5.5.1f1 or above:
Once Unity generates the XCode project, open it up and navigate to Classes/Preprocessor.h file.
There you should find following line of code:
#define UNITY_USES_REMOTE_NOTIFICATIONS 1
set it this to:
#define UNITY_USES_REMOTE_NOTIFICATIONS 0
That should do the job.

Please check out my plugin: Unity Asset Store - The Best Assets for Game Making which removes that warning after making your iOS builds.

If you are actually using Push Notifications, recreate your provisioning profile:

If you do not use Push Notifications, see @Piotrku’s answer.