evaluatedPolicyDomainState

Hi Apple Developers, I'm having a problem with evaluatedPolicyDomainState: on the same device, its value keeps changing and then switching back to the original. My current iOS version is 26.1. I upgraded my iOS from version 18.6.2 to 26.1. What could be the potential reasons for this issue?

{

    NSError *error;

    BOOL success = YES;

    char *eds = nil;

    int edslen = 0;

    LAContext *context = [[LAContext alloc] init];

    // test if we can evaluate the policy, this test will tell us if Touch ID is available and enrolled

    //    success = [context canEvaluatePolicy: LAPolicyDeviceOwnerAuthenticationWithBiometrics error:&error];

    

    if (SystemVersion > 9.3) {

        // test if we can evaluate the policy, this test will tell us if Touch ID is available and enrolled

        success = [context canEvaluatePolicy: LAPolicyDeviceOwnerAuthentication error:&error];

    }

    else{

        // test if we can evaluate the policy, this test will tell us if Touch ID is available and enrolled

        success = [context canEvaluatePolicy: LAPolicyDeviceOwnerAuthenticationWithBiometrics error:&error];

    }

    

    if (success)

    {

        if (@available(iOS 18.0, *)) {

            NSData *stateHash = nil;

            if ([context respondsToSelector:@selector(domainState)]) {

                stateHash = [[context performSelector:@selector(domainState)] performSelector:@selector(stateHash)];

            }else{

                stateHash = [context evaluatedPolicyDomainState];

            }

            eds = (char *)stateHash.bytes;

            edslen = (int)stateHash.length;

        } else {

            eds = (char *)[[context evaluatedPolicyDomainState] bytes];

            edslen = (int)[[context evaluatedPolicyDomainState] length];

        }

        

        

        CC_SHA256(eds, edslen, uviOut);

        

        *poutlen = CC_SHA256_DIGEST_LENGTH;

        

        

    }

    else

    {

        *poutlen = 32;

        gm_memset(uviOut, 0x01, 32);

    }

}
its value keeps changing and then switching back to the original

Can you expand on this? When does it change? Between different runs of your app? Or across OS upgrades? Or something else?

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

The user previously upgraded to version 26.1, then downgraded to 18.6.2 for certain reasons, and has now upgraded back to 26.1. Currently, an issue has occurred once on version 26.1 where two values keep switching back and forth. Since we record this value on the server during user registration, we noticed that the user’s value has changed. Moreover, this value will not change randomly, and the user stated that they have not modified the facial recognition data of the device.

Could there be a caching situation for this value in the system? And what is the basis for generating this value?

evaluatedPolicyDomainState
 
 
Q