mirror of
https://github.com/bitwarden/mobile
synced 2026-01-19 08:53:17 +00:00
PM-5154 Start implementing Passkeys Autofill in iOS
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
using AuthenticationServices;
|
||||
using Foundation;
|
||||
using UIKit;
|
||||
|
||||
namespace Bit.iOS.Core.Utilities
|
||||
{
|
||||
public static class ASCredentialIdentityStoreExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Saves password credential identities to the shared store of <see cref="ASCredentialIdentityStore"/>
|
||||
/// Note: This is added to provide the proper method depending on the OS version.
|
||||
/// </summary>
|
||||
/// <param name="identities">Password identities to save</param>
|
||||
public static Task<Tuple<bool, NSError>> SaveCredentialIdentitiesAsync(params ASPasswordCredentialIdentity[] identities)
|
||||
{
|
||||
if (UIDevice.CurrentDevice.CheckSystemVersion(17, 0))
|
||||
{
|
||||
return ASCredentialIdentityStore.SharedStore.SaveCredentialIdentityEntriesAsync(identities);
|
||||
}
|
||||
|
||||
return ASCredentialIdentityStore.SharedStore.SaveCredentialIdentitiesAsync(identities);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Removes password credential identities of the shared store of <see cref="ASCredentialIdentityStore"/>
|
||||
/// Note: This is added to provide the proper method depending on the OS version.
|
||||
/// </summary>
|
||||
/// <param name="identities">Password identities to remove</param>
|
||||
public static Task<Tuple<bool, NSError>> RemoveCredentialIdentitiesAsync(params ASPasswordCredentialIdentity[] identities)
|
||||
{
|
||||
if (UIDevice.CurrentDevice.CheckSystemVersion(17, 0))
|
||||
{
|
||||
return ASCredentialIdentityStore.SharedStore.RemoveCredentialIdentityEntriesAsync(identities);
|
||||
}
|
||||
|
||||
return ASCredentialIdentityStore.SharedStore.RemoveCredentialIdentitiesAsync(identities);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user