Search Unity

Overcoming issues with iOS App Store submissions

February 11, 2014 in Technology | 2 min. read
Placeholder image Unity 2
Placeholder image Unity 2
Topics covered
Share

Is this article helpful for you?

Thank you for your feedback!

Recently, we have received a number of reports indicating that Apple have tightened their review process, and have started rejecting apps that use iOS Advertising Identifier but do not show advertisements. This blog post will help you determine whether your app might be affected, and provide advice on how to overcome any issues you might face.

  1. Q: My application uses the Advertising Identifier API and it displays advertisements in a prominent place. Will it be accepted to the App Store?
    A: You should be fine.
  2. Q: My application uses the Advertising Identifier API, and it displays advertisements, but not continuously. Will it be accepted to the App Store?
    A: Ensure that advertisements are served during the Apple review. You might also need to pass on extra instructions to the reviewer providing information as to how to reach the part of your application that displays advertisements.
  3. Q: My application does not displays ads. What should I do?
    A: We are working on a fix to be released with the next release of Unity. If you are in a hurry, follow these instructions to remove the Advertising Identifier API from your Unity application:
    a) Locate DeviceSettings.mm file in your Xcode project (you should find it under Classes/Unity/) and open it for editing;
    b) Remove the following functions from the file:

        static id QueryASIdentifierManager()
        {
            //...
        }
        static void QueryAdID()
        {
            //...
        }
        static void QueryAdTracking()
        {
            //...
        }

    c) Remove the following declarations of variables:

        static NSString*    _ADID               = nil;
        static bool         _AdTrackingEnabled  = false;

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

  4. Q: I applied the suggested changes to my application and still got rejected from the App Store. Why might this be?
    A: Many 3rd party plugins, including social and analytics plugins, use the Advertising Identifier API directly. In such cases, you should contact the provider of your plugins for further instructions as to how to resolve this issue.
February 11, 2014 in Technology | 2 min. read

Is this article helpful for you?

Thank you for your feedback!

Topics covered