Sign In/Authorization

Many of the objects (e.g. ARKObjectTracker, ARKImageAnalyzer, and ARKEventReporter) must be configured with an authorized user and environment before they will work properly for online recognition. If they're not configured properly, face detection and tracking will still work, but face recognition and event reporting won't.

// Using the C API directly to configure the environment and authorized user
 
let configRef = ARKObjectTrackerConfigurationCreate()!
let envRef = ARKEnvironmentCopyNamed("com.real.PROD")
ARKObjectTrackerConfigurationSetObject(configRef, kARKObjectTrackerConfigurationKey_Environment, envRef)
 
let userRef = ARKUserCreate("<Username>", "<Password>")
ARKUserSetDirectory(userRef, "main")
ARKObjectTrackerConfigurationSetObject(configRef, kARKObjectTrackerConfigurationKey_User, userRef)
ARKObjectRelease(userRef);
 
ARKObjectRelease(envRef)
ARKObjectRelease(configRef)
// Using the Swift ArgusKit wrapper classes
 
let objectTrackerConfiguration = ObjectTrackerConfiguration()
let signInConfiguration = SignInConfiguration()
 
signInConfiguration.environment = "com.real.PROD"
signInConfiguration.username = "<Username>"
signInConfiguration.password = "<Password>"
signInConfiguration.directory = "main"
 
objectTrackerConfiguration.signInConfiguration = signInConfiguration

See Also