fix(keychain): mark useTouchID as required (#4182)

`useTouchID` is not an optional parameter. When it is not explicitly set, the whole app crashes with this error:
> Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSNull boolValue]: unrecognized selector sent to instance 0x111f02f08'

This bug is known since November 2018 and likely won't be fixed: https://github.com/ionic-team/cordova-plugin-ios-keychain/issues/34
This commit is contained in:
Pascal Clanget 2022-05-21 20:22:58 +02:00 committed by GitHub
parent f5b7b8469b
commit 6b2c1fd32e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -17,7 +17,7 @@ import { Cordova, AwesomeCordovaNativePlugin, Plugin } from '@awesome-cordova-pl
* *
* ... * ...
* *
* this.keychain.set(key, value).then(() => { * this.keychain.set(key, value, false).then(() => {
* this.keychain.get(key) * this.keychain.get(key)
* .then(value => console.log('Got value', value)) * .then(value => console.log('Got value', value))
* .catch(err => console.error('Error getting', err)); * .catch(err => console.error('Error getting', err));
@ -57,7 +57,7 @@ export class Keychain extends AwesomeCordovaNativePlugin {
@Cordova({ @Cordova({
callbackOrder: 'reverse', callbackOrder: 'reverse',
}) })
set(key: string, value: string | number | boolean, useTouchID?: boolean): Promise<any> { set(key: string, value: string | number | boolean, useTouchID: boolean): Promise<any> {
return; return;
} }