Problem setting custom prompt message when app asks for Touch ID/Passcode
Closed this issue · 3 comments
Hi,
I'm having trouble trying to set a custom prompt message when accessing Keychain.
I followed the documentation and set a new NSString
with my custom message:
NSString *message = NSLocalizedString(@"msg.keychain.prompt", nil);
NSString *savedValue = [keychain stringForKey:@"value" promptMessage:message];
The problem is: The message doesn't show up. I tried to debug to see if I can find the problem and when the code reaches the method - (NSDictionary *)queryFetchOneByKey:(NSString *)key message:(NSString *)message {
everything is nil, including message
. Therefore the message isn't displayed.
I'm running pod version 0.7.0
.
Any help is appreciated. Thanks!
If the message is nil, you can't expect anything to be displayed in the touch prompt. This is not a SimpleKeyChain issue, please reflect upon your usage of NSLocalizedString
@cocojoe I guess the string isn't the problem. The message
attribute exists until I call the queryFetchOneByKey
method. After that it simply becomes nil
. This might be due optimization when debugging...I tried also without NSLocalizedString and got the same result.
Found the problem. It was the self.useAccessControl
that was NO
. The nil
values were, confirmed, due to debug optimization.
My bad.