Search code examples
iosxamarin.iospush-notificationadmobentitlements

Do I need an Entitlements file for Distribution builds when I have push notifications?


I got an app rejected due to: "We found that your app failed to launch on iPhone 4 running iOS 5.0.1, on both Wi-Fi and cellular networks."

I am not sure of the reason since the adhoc builds are fine, but then I saw two things that may have affected it.

  1. I had compiler flags only for ad-hoc builds and not distribution. These are added because of AdMob. Guess this can be the reason?

    -v -v -v -gcc_flags "-framework AudioToolbox -framework MessageUI -framework
    SystemConfiguration -L${ProjectDir}/libs -lGoogleAdMobAds -force_load
    ${ProjectDir}/libs/libGoogleAdMobAds.a"

  2. I found a lot of posts about Entitlements file for ad-hoc but do I need it for production? I added my Entitlements.plist to the "Custom entitlements" entry in MonoTouch but not sure I need it. Can this be the reason? The entitlements file is here: ...

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"   "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
      <key>get-task-allow</key>
      <false/>
      <key>application-identifier</key>
      <string>$(AppIdentifierPrefix)$(CFBundleIdentifier)</string>
      <key>keychain-access-groups</key>
      <array>
        <string>$(AppIdentifierPrefix)$(CFBundleIdentifier)</string>
      </array>
    


Solution

  • I had compiler flags only for ad-hoc builds and not distribution. These are added because of AdMob. Guess this can be the reason?

    It could be. It depends on the bindings (how they are written) and how your application is written (error management).

    A quick test would be to try removing it from your ad-hoc builds to see if the application crash at startup. If it does then you can assume the same will happen at Apple when they are reviewing your application.

    I found a lot of posts about Entitlements file for ad-hoc but do I need it for production?

    I have not tried this myself but the answer to Push Notification is not working? points to created document which describe how you need to create an App ID and provide development and production SSL certificate for the push notification service.

    You should review the document and make sure your setup match.