The problem is solved.
I changed requestAlwaysAuthorization() tp requestWhenInUseAuthorization() and added NSLocationWhenInUseUsageDescription to info.plist. Once the prompt showed up everything started to work including the SpatialAnchors lib. Thanks for helping me!
Post
Replies
Boosts
Views
Activity
I'm not getting any prompt. Calling requestAlwaysAuthorization() in viewDidLoad of my view
class ARViewCtrl: UIViewController, MTKViewDelegate, UITextInputTraits, CLLocationManagerDelegate {
...
}
Why doesn't this prompt appear?
I have a Mac mini (2012) with macOS Catalina 10.15.7. So NEHotspotNetwork.fetchCurrent() is not available. Here is my test code:
mLocationManager = CLLocationManager()
mLocationManager!.delegate = self
mLocationManager!.requestAlwaysAuthorization()
...
func locationManager(_ manager: CLLocationManager, didChangeAuthorization status: CLAuthorizationStatus) {
print("status: \(status.rawValue)")
let interfaces = CNCopySupportedInterfaces() as NSArray?
print("interfaces: \(interfaces!.count)")
let interface = interfaces![0] as! CFString
print("interface: [\(interface)]")
let info = CNCopyCurrentNetworkInfo(interface) as NSDictionary?
if (info == nil) {
print("info: nil")
} else {
print("info: not nil")
}
}
// OUTPUT:
status: 0 (notDetermined)
interfaces: 1
interface: [en0]
2022-08-03 10:43:23.335260+0100 DimensionX[3066:1830775] [] nehelper sent invalid result code [1] for Wi-Fi information request
info: nil
Same problem. Apple, don't be Google!
Every cross-platform engine is written in C + + . Performance aside, having Metal C + + API would save tremendous amount of effort for developers worldwide.