You need to enable JavaScript to run this app.
最新活动
大模型
产品
解决方案
定价
生态与合作
支持与服务
开发者
了解我们

iOS Swift中设置App Tracking Transparency默认状态为.denied及隐藏特定App ATT弹窗的可行性咨询

Hey there! Let's tackle your questions about App Tracking Transparency (ATT) in iOS Swift development one by one:

1. Can you set the default ATT status to .denied?

Nope, you can't. The initial default status of ATTrackingManager.trackingAuthorizationStatus is always .notDetermined—this is controlled entirely by the iOS system, not your app. The status only changes when the user explicitly allows/denies tracking via the ATT popup, or if they've disabled tracking globally in their device settings. There's no API or workaround to force the default state to .denied at the app level.

2. Hiding ATT popup for apps not using IDFA, and setting status to .denied

Let's break this into two parts:

  • Hiding the ATT popup for this specific app
    This is totally feasible, and actually the correct approach if your app truly doesn't use IDFA (including no third-party SDKs that collect or use IDFA). The ATT popup only appears when you call ATTrackingManager.requestTrackingAuthorization() in your code. So for this app, simply don't call this method at all—the popup will never show up. For your other apps that need tracking, keep calling the method as usual, and the popup will display normally.

  • Can you force the tracking status to .denied permanently via code?
    No, this isn't allowed or possible. The trackingAuthorizationStatus property is read-only—you can only check its value, not modify it directly. Apple strictly prohibits apps from tampering with this status, as it violates user privacy controls. Trying to hack or work around this would likely result in your app being rejected during App Store review.

A key professional note:

Make 100% sure your app (and all integrated SDKs) don't use IDFA. Some SDKs enable IDFA collection by default, so you'll need to configure those SDKs to disable this feature. If Apple detects IDFA-related code in your app but you don't show the ATT popup, your submission could be rejected.

内容的提问来源于stack exchange,提问作者Himabindu

火山引擎 最新活动