|
| 1 | +// Copyright 2013 The Flutter Authors. All rights reserved. |
| 2 | +// Use of this source code is governed by a BSD-style license that can be |
| 3 | +// found in the LICENSE file. |
| 4 | +// Autogenerated from Pigeon (v9.2.5), do not edit directly. |
| 5 | +// See also: https://pub.dev/packages/pigeon |
| 6 | + |
| 7 | +#import <Foundation/Foundation.h> |
| 8 | + |
| 9 | +@protocol FlutterBinaryMessenger; |
| 10 | +@protocol FlutterMessageCodec; |
| 11 | +@class FlutterError; |
| 12 | +@class FlutterStandardTypedData; |
| 13 | + |
| 14 | +NS_ASSUME_NONNULL_BEGIN |
| 15 | + |
| 16 | +/// Possible outcomes of an authentication attempt. |
| 17 | +typedef NS_ENUM(NSUInteger, FLAAuthResult) { |
| 18 | + /// The user authenticated successfully. |
| 19 | + FLAAuthResultSuccess = 0, |
| 20 | + /// The user failed to successfully authenticate. |
| 21 | + FLAAuthResultFailure = 1, |
| 22 | + /// The authentication system was not available. |
| 23 | + FLAAuthResultErrorNotAvailable = 2, |
| 24 | + /// No biometrics are enrolled. |
| 25 | + FLAAuthResultErrorNotEnrolled = 3, |
| 26 | + /// No passcode is set. |
| 27 | + FLAAuthResultErrorPasscodeNotSet = 4, |
| 28 | +}; |
| 29 | + |
| 30 | +/// Pigeon equivalent of the subset of BiometricType used by iOS. |
| 31 | +typedef NS_ENUM(NSUInteger, FLAAuthBiometric) { |
| 32 | + FLAAuthBiometricFace = 0, |
| 33 | + FLAAuthBiometricFingerprint = 1, |
| 34 | +}; |
| 35 | + |
| 36 | +@class FLAAuthStrings; |
| 37 | +@class FLAAuthOptions; |
| 38 | +@class FLAAuthResultDetails; |
| 39 | +@class FLAAuthBiometricWrapper; |
| 40 | + |
| 41 | +/// Pigeon version of IOSAuthMessages, plus the authorization reason. |
| 42 | +/// |
| 43 | +/// See auth_messages_ios.dart for details. |
| 44 | +@interface FLAAuthStrings : NSObject |
| 45 | +/// `init` unavailable to enforce nonnull fields, see the `make` class method. |
| 46 | +- (instancetype)init NS_UNAVAILABLE; |
| 47 | ++ (instancetype)makeWithReason:(NSString *)reason |
| 48 | + lockOut:(NSString *)lockOut |
| 49 | + goToSettingsButton:(NSString *)goToSettingsButton |
| 50 | + goToSettingsDescription:(NSString *)goToSettingsDescription |
| 51 | + cancelButton:(NSString *)cancelButton |
| 52 | + localizedFallbackTitle:(nullable NSString *)localizedFallbackTitle; |
| 53 | +@property(nonatomic, copy) NSString *reason; |
| 54 | +@property(nonatomic, copy) NSString *lockOut; |
| 55 | +@property(nonatomic, copy) NSString *goToSettingsButton; |
| 56 | +@property(nonatomic, copy) NSString *goToSettingsDescription; |
| 57 | +@property(nonatomic, copy) NSString *cancelButton; |
| 58 | +@property(nonatomic, copy, nullable) NSString *localizedFallbackTitle; |
| 59 | +@end |
| 60 | + |
| 61 | +@interface FLAAuthOptions : NSObject |
| 62 | +/// `init` unavailable to enforce nonnull fields, see the `make` class method. |
| 63 | +- (instancetype)init NS_UNAVAILABLE; |
| 64 | ++ (instancetype)makeWithBiometricOnly:(NSNumber *)biometricOnly |
| 65 | + sticky:(NSNumber *)sticky |
| 66 | + useErrorDialogs:(NSNumber *)useErrorDialogs; |
| 67 | +@property(nonatomic, strong) NSNumber *biometricOnly; |
| 68 | +@property(nonatomic, strong) NSNumber *sticky; |
| 69 | +@property(nonatomic, strong) NSNumber *useErrorDialogs; |
| 70 | +@end |
| 71 | + |
| 72 | +@interface FLAAuthResultDetails : NSObject |
| 73 | +/// `init` unavailable to enforce nonnull fields, see the `make` class method. |
| 74 | +- (instancetype)init NS_UNAVAILABLE; |
| 75 | ++ (instancetype)makeWithResult:(FLAAuthResult)result |
| 76 | + errorMessage:(nullable NSString *)errorMessage |
| 77 | + errorDetails:(nullable NSString *)errorDetails; |
| 78 | +/// The result of authenticating. |
| 79 | +@property(nonatomic, assign) FLAAuthResult result; |
| 80 | +/// A system-provided error message, if any. |
| 81 | +@property(nonatomic, copy, nullable) NSString *errorMessage; |
| 82 | +/// System-provided error details, if any. |
| 83 | +@property(nonatomic, copy, nullable) NSString *errorDetails; |
| 84 | +@end |
| 85 | + |
| 86 | +@interface FLAAuthBiometricWrapper : NSObject |
| 87 | +/// `init` unavailable to enforce nonnull fields, see the `make` class method. |
| 88 | +- (instancetype)init NS_UNAVAILABLE; |
| 89 | ++ (instancetype)makeWithValue:(FLAAuthBiometric)value; |
| 90 | +@property(nonatomic, assign) FLAAuthBiometric value; |
| 91 | +@end |
| 92 | + |
| 93 | +/// The codec used by FLALocalAuthApi. |
| 94 | +NSObject<FlutterMessageCodec> *FLALocalAuthApiGetCodec(void); |
| 95 | + |
| 96 | +@protocol FLALocalAuthApi |
| 97 | +/// Returns true if this device supports authentication. |
| 98 | +/// |
| 99 | +/// @return `nil` only when `error != nil`. |
| 100 | +- (nullable NSNumber *)isDeviceSupportedWithError:(FlutterError *_Nullable *_Nonnull)error; |
| 101 | +/// Returns true if this device can support biometric authentication, whether |
| 102 | +/// any biometrics are enrolled or not. |
| 103 | +/// |
| 104 | +/// @return `nil` only when `error != nil`. |
| 105 | +- (nullable NSNumber *)deviceCanSupportBiometricsWithError:(FlutterError *_Nullable *_Nonnull)error; |
| 106 | +/// Returns the biometric types that are enrolled, and can thus be used |
| 107 | +/// without additional setup. |
| 108 | +/// |
| 109 | +/// @return `nil` only when `error != nil`. |
| 110 | +- (nullable NSArray<FLAAuthBiometricWrapper *> *)getEnrolledBiometricsWithError: |
| 111 | + (FlutterError *_Nullable *_Nonnull)error; |
| 112 | +/// Attempts to authenticate the user with the provided [options], and using |
| 113 | +/// [strings] for any UI. |
| 114 | +- (void)authenticateWithOptions:(FLAAuthOptions *)options |
| 115 | + strings:(FLAAuthStrings *)strings |
| 116 | + completion:(void (^)(FLAAuthResultDetails *_Nullable, |
| 117 | + FlutterError *_Nullable))completion; |
| 118 | +@end |
| 119 | + |
| 120 | +extern void FLALocalAuthApiSetup(id<FlutterBinaryMessenger> binaryMessenger, |
| 121 | + NSObject<FLALocalAuthApi> *_Nullable api); |
| 122 | + |
| 123 | +NS_ASSUME_NONNULL_END |
0 commit comments