A session that your app uses to protect an assessment.
- iOS 13.4+
- macOS 10.15.4+
AEAssessment class to manage an assessment session. The system allows only one active session at a time across all processes. The first session to run gets exclusive access to the system; subsequent session attempts fail until the first session ends.
To create an assessment session, pass a new
AEAssessment instance to the
init(configuration:) method. Then, provide the session with a delegate that conforms to the
The session tells its delegate about state changes during its life cycle. To start a session, call the session’s
The method returns immediately, and the session starts disabling system features. After achieving the desired state, the session calls its delegate’s
assessment method. Only after receiving this callback is it safe to begin your assessment. Be sure to keep a strong reference to the session as long as you want it to remain active. If the system deallocates an active session, the session automatically ends.
After completing an assessment and hiding all sensitive information, call the session’s
After making the call, wait for the session to call its delegate’s
assessment method before reporting assessment completion to the user.
During assessment, the session’s delegate might receive an
assessment callback to indicate a failure. If this happens, immediately stop the assessment, hide all sensitive content, and end the session. Because it might take time for your app to finalize the assessment, the session relies on your app to call the session’s