应用跟踪透明度不显示对话Bbox
我已经尝试了其他相关问题中的解决方案,但是答案对我不起作用。
我已经设置了应用程序跟踪透明度,但是由于某种原因,它的对话框永远不会在屏幕上显示。这是我正在使用的代码:
func appTrackingAuthorisation() {
DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
ATTrackingManager.requestTrackingAuthorization { status in
switch status {
case .authorized:
print("Enable tracking")
case .denied:
print("Deny tracking")
case .restricted:
print("Restrict (denied) tracking")
default:
print("Not determined")
}
}
}
}
我的viewDidload()中
override func viewDidLoad() {
super.viewDidLoad()
appTrackingAuthorisation()
checkLocationServices()
}
在 导致ATT不出现。我已经尝试将其放入func ApplicationDidBecomeycomecomective(_ application:uiapplication)
中的AppDelegate中,因为这是Apple建议的,但仍然不起作用。还设置了info.plist中的nsusertrackingusagedescription。还允许应用程序要求跟踪。
I've tried the solutions in other related questions but none of the answers work for me.
I've got App Tracking Transparency set up but for some reason, the dialogue box for it never shows on screen. This is the code I'm using:
func appTrackingAuthorisation() {
DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
ATTrackingManager.requestTrackingAuthorization { status in
switch status {
case .authorized:
print("Enable tracking")
case .denied:
print("Deny tracking")
case .restricted:
print("Restrict (denied) tracking")
default:
print("Not determined")
}
}
}
}
In my viewDidLoad()
is where I'm calling the function:
override func viewDidLoad() {
super.viewDidLoad()
appTrackingAuthorisation()
checkLocationServices()
}
I also have a location permission dialogue box show and I'm not sure if that being there is causing the ATT to not show up. I've tried putting it in AppDelegate in func applicationDidBecomeActive(_ application: UIApplication)
as that's what Apple recommends but it still doesn't work. NSUserTrackingUsageDescription in Info.plist is also set. Allow apps to ask for tracking is also enabled.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论