ios - SecItemAdd not prompting for Touch ID -
i have odd problem secitemadd() seems vary between ios 8 , 9. ios 8, saving secure enclave prompt touch id authentication (unless have specified ksecusenoauthenticationui @yes). expect. however, on ios 9, never seem touch id authentication on secitemadd.
i realize between 8 , 9 there change attributes, , ksecusenoauthenticationui deprecated in favour of ksecuseauthenticationui, regardless of whether omit ksecuseauthenticationui, or specify @yes, never prompted.
what should secitemadd() do?
here code snippet of attempting:
cferrorref error = null; secaccesscontrolref sacobject; sacobject = secaccesscontrolcreatewithflags(kcfallocatordefault, ksecattraccessiblewhenpasscodesetthisdeviceonly, ksecaccesscontroluserpresence, &error); nsdictionary *attributes = @{ (__bridge id)ksecclass: (__bridge id)ksecclassgenericpassword, (__bridge id)ksecattrservice: @"zenbanx", (__bridge id)ksecattraccount: tokenkey, (__bridge id)ksecvaluedata: [tokenvalue datausingencoding:nsutf8stringencoding], / (__bridge id)ksecusenoauthenticationui: @no, (__bridge id)ksecuseauthenticationui: @yes, (__bridge id)ksecattraccesscontrol: (__bridge_transfer id)sacobject }; osstatus status = secitemadd((__bridge cfdictionaryref) attributes, nil);
my goal have code presents same user interaction between ios 8 , 9.
thanks, in advance.
ksecuseauthenticationui takes ksecuseauthenticationuiallow, ksecuseauthenticationuifail , ksecuseauthenticationuiskip. in case should use ksecuseauthenticationuiallow.
Comments
Post a Comment