【发布时间】:2026-01-08 14:35:02
【问题描述】:
我正在尝试使用 Countly 从我的最终二进制文件中排除 IDFA,以便对出口合规性问题“您的应用程序使用 IDFA 吗?”回答否。
将COUNTLY_EXCLUDE_IDFA=1 添加到Build Settings > Preprocessor Macros 如提到的here 不起作用。
我已将其范围缩小到 #ifndef 的行为不符合预期。这是我尝试过的:
在Build Settings > Preprocessor Macros 中添加COUNTLY_EXCLUDE_IDFA=1:
#ifndef COUNTLY_EXCLUDE_IDFA
printf("!EXCLUDED\n");
#else
printf("EXCLUDED\n");
#endif
>> prints !EXCLUDED
COUNTLY_EXCLUDE_IDFA 未在 Build Settings > Preprocessor Macros 中定义:
#ifndef COUNTLY_EXCLUDE_IDFA
printf("!EXCLUDED\n");
#else
printf("EXCLUDED\n");
#endif
>> prints !EXCLUDED
如果未定义宏,我希望#ifndef 包含一个块。现在#ifndef 块被包含在我是否有在Build Settings > Preprocessor Macros 中定义的宏。
【问题讨论】:
-
当您在
Preprocessor Macros中设置此宏时,我想您只是在发布版本下设置它,对吧?在这种情况下,您展示的这些测试是来自发布版本还是调试版本? -
我已经为所有构建配置设置了
Preprocessor Macros,因此永远不会包含 IDFA。我已经在调试版本中对此进行了测试。当我将发布二进制文件上传到 AppStoreConnect 时,我收到一条警告,指出 IDFA 也包含在二进制文件中。
标签: ios objective-c c-preprocessor countly-analytics