Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Binary Rejected - [ASIdentifierManager advertisingIdentifier] #109

Closed
neoneye opened this issue Feb 1, 2014 · 29 comments
Closed

Binary Rejected - [ASIdentifierManager advertisingIdentifier] #109

neoneye opened this issue Feb 1, 2014 · 29 comments

Comments

@neoneye
Copy link

neoneye commented Feb 1, 2014

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
Copy link
Contributor

ttrefren commented Feb 1, 2014

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
Copy link
Author

neoneye commented Feb 1, 2014

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
Copy link
Author

neoneye commented 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)

@rhfung
Copy link

rhfung commented Feb 3, 2014

@yas375
Copy link
Contributor

yas375 commented Feb 4, 2014

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

@alex-hofsteede
Copy link
Contributor

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

@neoneye
Copy link
Author

neoneye commented Feb 5, 2014

Thank you Alex, commit cff370230a2e37dfe65ef5cab33cbdd1bc3562c7 looks great.

@devValley
Copy link

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

@alex-hofsteede
Copy link
Contributor

@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
Copy link
Contributor

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
Copy link

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
Copy link
Contributor

@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
Copy link
Contributor

@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
Copy link

@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
Copy link
Contributor

@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
Copy link

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
Copy link

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
Copy link

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
Copy link

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

@lemonkey
Copy link

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
Copy link

If you remove AdSupport framework (assuming you're not using it and it was erroroneously included) does it pass Apple's pre-submission test with the preprocessor flag?

Marshall

Manager, Support
Mixpanel

On Sat, Jan 10, 2015 at 1:29 PM -0800, "Ari Braginsky" notifications@github.com wrote:

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.


Reply to this email directly or view it on GitHub.

@lemonkey
Copy link

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
Copy link

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
Copy link

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
Copy link

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

@bigdllmask1333
Copy link

How do I get IDFA with PHP?

@pchien
Copy link
Contributor

pchien commented Jul 25, 2017

@cww0128 I'm not sure I understand what you're asking. Do you have some iOS framework that lets you use PHP to integrate our library?

@bigdllmask1333
Copy link

@pchien
Our boss told me to write an interface in PHP language, and let the IOS system user access the interface to get the unique identifier of the IOS user's cell phone, that is, IDFA. But when the client accesses my interface through the browser, I can only get the cell phone, Android or IOS, and the model of the phone, so I can't get the IDFA of the IOS phone!

the boss is kidding me?! At least I think the simple grab HTTP response header information, simply can not get IDFA, so I want to change a train of thought, I do not know if there is no interface to get IOS IDFA!

I'm sorry, I wrote it through Baidu translation. It might be a bit awkward to read

@pchien
Copy link
Contributor

pchien commented Jul 25, 2017

@cww0128 sorry I don't know what's accessible through PHP in the browser. Our SDK is for people trying to integrate Mixpanel in native apps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests