允许用户在 iOS 个应用中切换应用跟踪同意状态

Enable user to toggle App Tracking Consent status within iOS app

如何使用户能够在具有新的应用跟踪透明度要求的 实时 iOS 应用中的菜单中轻松切换同意?我曾经在没有 Apple 的 ATT 要求的情况下通过复选标记按钮跟踪用户同意。我仍然可以使用此同意状态吗?我可以通过网络视图跟踪同意吗?

TL;DR

没有。没有 Apple,我们无法在本地切换用户同意。即,现在 Analytics 的同意状态具有单一事实来源 (Source)。

没有 Apple 框架的跟踪同意

If I have not received permission from a user via the tracking permission prompt, can I use an identifier other than the IDFA (for example, a hashed email address or hashed phone number) to track that user?

No. You will need to receive the user’s permission through the AppTrackingTransparency framework to track that user.

改为通过网站跟踪同意

If a user provides permission for tracking via a separate process on our website, but declines permission in the app tracking transparency prompt, can I track that user across apps and websites owned by other companies?

Developers must get permission via the app tracking transparency prompt for data that’s collected in the app and used for tracking. Data collected separately, outside of the app and not related to the app, is not in scope.

备选

无法访问应用内的 iOS Settings -> Privacy -> Tracking 菜单,因为 URL 设置方案在 iOS 10+ 中已弃用。

但你不需要走那么远:

if let appSettings = URL(string: UIApplication.openSettingsURLString) {
    UIApplication.shared.open(appSettings, options: [:], completionHandler: nil)
}

“设置”中的应用页面还可以选择仅为您的应用切换同意。请记住在 Apple 同意的情况下跟踪您的同意状态 每次应用启动,因为用户可以随时更改此值。有关详细信息,请参阅 here