ios - 允许用户在 iOS 应用程序内切换应用程序跟踪同意状态

标签 ios swift ios14

如何让用户能够在符合新应用跟踪透明度要求的实时 iOS 应用内部菜单中轻松切换同意?我曾经通过复选标记按钮来跟踪用户同意情况,而无需 Apple 的 ATT 要求。我还可以使用此同意状态吗?我可以通过 WebView 来跟踪同意情况吗?

最佳答案

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 设置 -> 隐私 -> 跟踪 菜单,因为设置的 URL 方案在 iOS 10+ 中已被弃用。

但你不需要走那么远:

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

“设置”中的应用页面还可以选择仅为您的应用切换同意。请记住在每次应用启动时跟踪您的同意状态,并获得 Apple 的同意,因为用户可以随时更改此值。欲了解更多信息,请参阅here .

关于ios - 允许用户在 iOS 应用程序内切换应用程序跟踪同意状态,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67596403/

相关文章:

ios - 在 iOS 13 上的 Swift 中设置 Sign in with Apple for Firebase 时出错的原因是什么?

ios - objective-c : how to execute a function when app is in the background/killed automatically based on time Intervals

swift5 - 如何快速获取当前连接的 Wifi 网络的 SSID | iOS 14?

ios - CLLocationManager 的 AuthorizationStatus 在 iOS 14 上已弃用

ios - 滚动时保持 UITableViewCell 可见? ( swift 3)

ios - SwiftUI 中默认展开的 List 或 OutlineGroup

ios - 在 ios 中与 inapp 电子邮件作斗争

ios - 核心数据对象的顺序改变,核心数据合并后上下文之间不同

ios - swift 类 'nil' 中的所有值

java - 如何在不定义新类的情况下在 Swift 中实现 Objective-C