当我在 xCode 5 中验证我的应用程序时,出现错误不正确的广告标识符 [IDFA] 使用

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/23335230/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 04:54:00  来源:igfitidea点击:

Getting error improper advertising identifier [IDFA] usage,when i am validating my app in xCode 5

iosobjective-cxcode

提问by Ashok

when validating my app, I get an error saying

验证我的应用程序时,我收到一条错误消息

"Improper Advertising Identifier Usage. Your app contains the Advertising Identifier [IDFA] API but you have not respecting the Limit Ad Tracking setting in iOS."

“广告标识符使用不当。您的应用程序包含广告标识符 [IDFA] API,但您没有遵守 iOS 中的限制广告跟踪设置。”

I have check "Yes" on the Prepare for Upload page for Advertising Identifier.I am using revmob ads and flurry analytics in my app(COCOS2D-X project).How to fix this issue, I have tried a lot but not succeed.I have use below code into appdelegate but no luck.

我在广告标识符的准备上传页面上勾选了“是”。我在我的应用程序(COCOS2D-X 项目)中使用了 revmob 广告和 flurry 分析。如何解决这个问题,我已经尝试了很多但没有成功。我已将以下代码用于 appdelegate,但没有运气。

- (NSString *)identifierForAdvertising
{
   if([[ASIdentifierManager sharedManager] isAdvertisingTrackingEnabled])
   {
       NSUUID *IDFA = [[ASIdentifierManager sharedManager] advertisingIdentifier];

       return [IDFA UUIDString];
   }

    return nil;
}  

Screen Shot

截屏

回答by Liam

this IDFA issue was still happening for me today. I tracked it down to the GoogleAnalytics pod, so I just updated the pod to the latist version by specifying pod 'GoogleAnalytics-iOS-SDK', '~> 3.0.7'in the podfile which fixed the issuefor me. the version was previously unspecified but was using 3.0.3.

这个 IDFA 问题今天仍然发生在我身上。我将其追踪到GoogleAnalytics pod,因此我只是通过pod 'GoogleAnalytics-iOS-SDK', '~> 3.0.7'在 podfile 中指定为我解决了问题的方式将 pod 更新为 laist 版本。该版本以前未指定,但使用的是 3.0.3。

回答by djogon

Around April 26th Apple changed their IDFA scanning procedures. Not only do you have to check the appropriate checkboxes after you click on the "prepare for upload", but your code (or any other third party library that you have must use IDFA by using the class directly.

4 月 26 日左右,Apple 更改了他们的 IDFA 扫描程序。单击“准备上传”后,您不仅必须选中相应的复选框,而且您的代码(或您拥有的任何其他第三方库必须通过直接使用类来使用 IDFA。

Someone suggested to do this:

"you can do that by replacing direct refs to ASIdentifierManager with NSClassFromString(@"ASIdentifierManager")"

有人建议这样做:

“你可以通过用 NSClassFromString(@"ASIdentifierManager") 替换对 ASIdentifierManager 的直接引用来做到这一点”

DO NOT load this class using this approach! New scanning procedure will look specifically for this and if it is found instead of direct references - Apple seems to assume that there is some strange usage of the tracking identifier. I can't say I disagree with that decision.

不要使用这种方法加载这个类!新的扫描程序将专门为此查找,如果找到它而不是直接引用 - Apple 似乎认为跟踪标识符有一些奇怪的用法。我不能说我不同意这个决定。

It may not be easy to find exactly which library is at fault. Latest AdMob SDK for example is using the class directly and is NOT the source of a problem.

确切地找出哪个库有问题可能并不容易。例如,最新的 AdMob SDK 直接使用该类,而不是问题的根源。

One way you can find out which library is the source of the problem is to remove AdSupport.Framework from your project and see which libraries fail to link. Those libraries are NOT the problem. See if you have other advertising libraries that do not require you to include AdSupport.Framework - those are most likely the culprit.

您可以找出哪个库是问题根源的一种方法是从您的项目中删除 AdSupport.Framework 并查看哪些库无法链接。这些库不是问题所在。看看您是否有其他不需要包含 AdSupport.Framework 的广告库 - 这些很可能是罪魁祸首。

It sounds a bit counter intuitive, but the direct referencing is not the problem, dynamic (weak) loading of that class is.

这听起来有点违反直觉,但直接引用不是问题,该类的动态(弱)加载才是问题。

Hope this helps someone - we were pulling our hair out until we found what was the source of the issue.

希望这对某人有所帮助 - 我们一直在努力,直到找到问题的根源。

回答by rishabh

Looks like Apple has reverted the changes now. All apps are going through just as usual again :)

看起来苹果现在已经恢复了这些变化。所有应用程序都将再次像往常一样运行:)