Binary Rejected - [ASIdentifierManager advertisingIdentifier] #109

Closed
neoneye opened this Issue Feb 1, 2014 · 25 comments

Projects

None yet
@neoneye

I had my app in review and it got rejected. My app doesn't show any ads. I have tried to remove the AdSupport.framework, but MixPanel depends on it.

Below is the detailed text I got from Apple describing the problem


PLA 3.3.12

We found your app uses the iOS Advertising Identifier but does not include ad functionality. This does not comply with the terms of the iOS Developer Program License Agreement, as required by the App Store Review Guidelines.

Specifically, section 3.3.12 of the iOS Developer Program License Agreement states:

"You and Your Applications (and any third party with whom you have contracted to serve advertising) may use the Advertising Identifier, and any information obtained through the use of the Advertising Identifier, only for the purpose of serving advertising. If a user resets the Advertising Identifier, then You agree not to combine, correlate, link or otherwise associate, either directly or indirectly, the prior Advertising Identifier and any derived information with the reset Advertising Identifier."

Please check your code - including any third-party libraries - to remove any instances of:

class: ASIdentifierManager
selector: advertisingIdentifier
framework: AdSupport.framework

If you are planning to incorporate ads in a future version, please remove the Advertising Identifier from your app until you have included ad functionality.

To help locate the Advertising Identifier, use the “nm” tool. For information on the “nm” tool, open a terminal window and enter, “man nm.”

If you do not have access to the libraries source, you may be able to search the compiled binary using the "strings" or "otool" command line tools. The "strings" tool lists the methods that the library calls, and "otool -ov" will list the Objective-C class structures and their defined methods. These techniques can help you narrow down where the problematic code resides.

@ttrefren
Mixpanel, Inc member

Hey Simon, so sorry about this. We default to using the IFA (ID for Advertisers) for users, which requires the adsupport framework. You can turn this off, though, and we'll use a different ID by default.

If you look at https://github.com/mixpanel/mixpanel-iphone/blob/master/Mixpanel/Mixpanel.h#L241 there's a comment explaining a little more. Basically, you can add the MIXPANEL_NO_IFA preprocessor flag in your build settings and we will not require the AdSupport framework.

You may also have to remove the import. I'm not our iOS guy so I'm a little out of my depth here, but wanted to give you a quick turnaround. Alex may be able to give you more detail later today.

@neoneye

I was using an older MixPanel 2.0.1 and the MIXPANEL_NO_IFA ifdef looks like it's exactly what I'm looking for.

Thank you Tim for quick help.

@neoneye

Perhaps make a cocoapod subspec where MIXPANEL_NO_IFA is defined

s.subspec 'NOIFA' do |subspec|
    subspec.prefix_header_contents = #define MIXPANEL_NO_IFA
end

(untested)

@rhfung

I forked Mixpanel to add the constant:

rhfung@1c32974

@yas375

FYI, looks like it was fixed in the latest release: https://github.com/mixpanel/mixpanel-iphone/releases/tag/v2.3.1

@alex-hofsteede

Yep, we've released version 2.3.1 that should solve this.

Short story: If you have included AdSupport.framework in your app for your iAds, you are allowed to use IFA and the Mixpanel library will continue to use IFA as the default. If you don't use iAds and don't include AdSupport.framework in your app, we won't use IFA.

Longer story: We have removed any dependencies on AdSupport from the Mixpanel library, and we now do a runtime check using NSClassFromString and NSSelectorFromString so we don't directly reference any of the AdSupport symbols and the app binary will come up clean under nm and otool

@devValley

@alex-hofsteede What about strings tool, will the app binary come up clean under strings?

@alex-hofsteede

@devValley the string @"advertisingIdentifier" will still show up in the binary. I'm not sure Apple uses that as a criterion for the app store, as that would effectively be saying that that particular string is forbidden anywhere in your app. I'm guessing they are more interested in the symbol table entries returned by nm but the app store review process is notoriously opaque.

If the strings are a concern for your project, you can still use the MIXPANEL_NO_IFA compiler flag to completely remove the block of code that does the checking for AdSupport.framework.

Also if the strings do turn out to be a problem, then we could always do something simple like ROT13-ing them to obfuscate it more.

@justinmakaila

Adding the preprocessor flag in the project build settings did not help me, I had to actually put the #define MIXPANEL_NO_IFA in the top of the file.

@SwiftArchitect

same. When using Cocoapods, neither Preprocessor Macros MIXPANEL_NO_IFA=1 nor User-Defined setting MIXPANEL_NO_IFA:1 have any effect.

Edit: This was an Xcode snafu.
Furthermore, NSClassFromString(@"ASIdentifierManager") succeeds even though AdSupport.framework is nowhere to be found in my project.

@alex-hofsteede

@justinmakaila That is really odd, are you sure that the flag in the XCode build settings is set correctly on your release build? I know that there are times when the Target setttings can override the Project settings. Using the 'Levels' view will show more info. http://cl.ly/image/313H101W3r0Q

Other than that I'm at a loss to explain why preprocessor flags defined in your build settings wouldn't be applied to the file. I'll look into it further.

@alex-hofsteede

@arquebuse Are you using any other 3rd party libraries that could have AdSupport compiled in? I have been testing for a while now but I have been unable to replicate the situation where AdSupport.framework is not in the project, but NSClassFromString(@"ASIdentifierManager") still returns a valid class.

@SwiftArchitect

@alex-hofsteede I was not expecting any help, this was a rhetorical comment. But since you did respond, here is what I have found. One, I was using Mixpanel (2.2.3). Two, deleting my project directory and checking out my files from scratch, in addition to reboot and much coffee addressed the NSClassFromString(@"ASIdentifierManager") weirdness. Three, below is my Xcode 5.1 Project + Target settings. Where did I go wrong?
mixpanel_no_ifa

@alex-hofsteede

@arquebuse Yeah the macro value does look correct, Can you also check that the same preprocessor macro is set in the Target settings. I think the Target settings generally override the Project settings.

Here for example, I defined TEST_MACRO in the Project settings, and TEST_MACRO_2 in the Target settings, and the final/resolved value comes out with only TEST_MACRO_2

example

@SwiftArchitect

I verified that MIXPANEL_NO_IFA is defined at the target level, too. In fact, mistakenly overwriting MIXPANEL_NO_IFA in the target could not possibly matter because Mixpanel.m does not care about the actual value of MIXPANEL_NO_IFA, merely its existence. Once defined in Xcode project level, I don't think it can be undefined in the target level.

Just to clarify: The objective of this conversation is to somehow only touch my project, and not the Cocoapods projects or files. Of course defining MIXPANEL_NO_IFA at the Pod level would address all issues.

I upgraded to Xcode 5.1.1, added the "Any Architecture | Any SDK" sections. To no avail. I still hit the breakpoint below. Though since there is no AdSupport.framework in the executable, ASIdentifierManagerClass is nil, and -IFA returns nil.

screen shot 2014-05-16 at 4 24 15 pm

@sternhenri

This (Apple rejecting binaries) is still happening with 2.3.6, and preprocessor macros defined (the #ifndef clause isn't getting hit).

Any advice?

@drmarshall

Marshall here from Mixpanel Support. @sternhenri Can you please check your "Linked Frameworks and Libraries" for the AdSupport.framework? If this is present, Apple will reject the binary regardless of the Mixpanel preprocessor.

@sternhenri

@drmarshall Duh! Sorry about that, thanks for your help!

@jonalmeida jonalmeida referenced this issue in snowplow/snowplow-objc-tracker Oct 17, 2014
Closed

Only use IFA if AdSupport is included #76

@lemonkey

Still a problem if you're using CocoaPods unless you manually update your Pods-Mixpanel target build settings to add the preprocessor macro MIXPANEL_NO_IFA=1, which of course get overwritten the next time you do a pod update. My recent app update was rejected because it is displaying iAds and using MixPanel.

For some reason the reviewer thinks I'm not displaying ads in the app, but they do appear when I test it -- perhaps they're behind a firewall or testing airplane mode. Anyway, due to the fact that I am using the iAd framework, Mixpanel is using the IFA.

@drmarshall
@lemonkey

I'm not using the AdSupport framework anywhere in the project, and Apple did mention in the rejection notice:

Note: iAd does not use the AdSupport framework, ASIdentifierManager, or the Advertising Identifier. Therefore they are not required for iAd implementations and should not be included in your app for iAd support.

Note: that the build I submitted did pass the pre-submission test. I posted a reply to their rejection with screenshots showing the iAd in the app and am going to wait a few days to hear back. My best guess is that the tester is on a network that isn't allowing the iAd to load, and hence they're not seeing the ad anywhere but they are seeing that Mixpanel is tracking using IFA.

@lemonkey

Was there any traction on a pod spec that allows you to specify that you want to disable IFA? See

neoneye commented on Feb 1, 2014
Perhaps make a cocoapod subspec where MIXPANEL_NO_IFA is defined
s.subspec 'NOIFA' do |subspec|
subspec.prefix_header_contents = #define MIXPANEL_NO_IFA
end
(untested)

@lemonkey

Apple wrote back:

Thank you for the information. However, iAd does not use the AdSupport framework, ASIdentifierManager, or the Advertising Identifier. Therefore they are not required for iAd implementations and should not be included in your app for iAd support.

I'm going to have to resubmit, making sure that MIXPANEL_NO_IFA is set on the Pod target for Mixpanel. It would be nice to have a subspec that can do this...

@justking14

But i need the iAd framework to make the Facebook framework work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment