Unity iOS7 Submission Issues

If you have had App Store rejections since the beginning of February, this Unity blog might help.

Apparently, one of the recent changes requires that any project that have an Advertising Identifier to show advertisements. Unity, as an engine, provides an Advertising Identifier to allow those apps that would like to acquire revenue through in-app ads to do so, but this is causing apps that do not display adds to be rejected.

This is possibly related to similar rejections in UDK projects, to which a solution has not yet been released.

The Solution

Unity Technologies is working to include a fix for this in the next release of Unity, however there are steps you can take to correct the issue now. Per the Unity blog post:

…follow these instructions to remove the Advertising Identifier API from your Unity application:

  1. Locate DeviceSettings.mm file in your Xcode project (you should find it under Classes/Unity/) and open it for editing;
     
  2. Remove the following functions from the file:
        static id QueryASIdentifierManager()
        {
            //...
        }
        static void QueryAdID()
        {
            //...
        }
        static void QueryAdTracking()
        {
            //...
        }

  3. Remove the following declarations of variables:
        static NSString*    _ADID               = nil;
        static bool         _AdTrackingEnabled  = false;

  4. Modify implementations of the following the functions (replace with those provided below):
        extern "C" const char*  UnityAdvertisingIdentifier()
        {
        return NULL;
        }
    
        extern "C" bool         UnityAdvertisingTrackingEnabled()
        {
        return false;
        }
    
        static void QueryDeviceID()
        {
            if(_DeviceID == nil)
            {
            #if UNITY_PRE_IOS7_TARGET
                if(!_ios70orNewer)
                    _InitDeviceIDPreIOS7();
            #endif
    
                // first check vendor id
                if(_DeviceID == nil)
                {
                    QueryVendorID();
                    _DeviceID = _VendorID;
                }
            }
        }

These modifications only affect the current build of your Xcode project. If you rebuild an Xcode project from Unity and choose to replace it or build it to a new location, you need to reapply these changes. If you do not intend to show any advertisements anywhere in your project, consider updating the master template of this file located at: /Applications/Unity/Unity.app/Contents/PlaybackEngines/iPhonePlayer/iPhone-Trampoline/Classes/Unity

Furthermore, it is noted that 3rd party plug-ins, most often social and analytics, also utilize the Advertising Identifier, which can cause rejection by the App Store. If you continue to receive rejections, verify your plug-ins and contact the developer to see if the Advertising Identifier can be removed.

Additional Information

Full information about these issues can be found in the Overcoming issues with iOS App Store submissions article on the Unity blog.

Browncoat Jayson

Join me in New Britannia!

You may also like...

Leave a Reply