@@ -101,7 +101,6 @@ @interface FLTFirebaseAuthPlugin ()
101
101
@end
102
102
103
103
@implementation FLTFirebaseAuthPlugin {
104
- #if TARGET_OS_IPHONE
105
104
// Map an id to a MultiFactorSession object.
106
105
NSMutableDictionary <NSString *, FIRMultiFactorSession *> *_multiFactorSessionMap;
107
106
@@ -114,8 +113,6 @@ @implementation FLTFirebaseAuthPlugin {
114
113
// Map an id to a MultiFactorResolver object.
115
114
NSMutableDictionary <NSString *, FIRTOTPSecret *> *_multiFactorTotpSecretMap;
116
115
117
- #endif
118
-
119
116
NSObject <FlutterBinaryMessenger> *_binaryMessenger;
120
117
NSMutableDictionary <NSString *, FlutterEventChannel *> *_eventChannels;
121
118
NSMutableDictionary <NSString *, NSObject <FlutterStreamHandler> *> *_streamHandlers;
@@ -133,13 +130,10 @@ - (instancetype)init:(NSObject<FlutterBinaryMessenger> *)messenger {
133
130
_eventChannels = [NSMutableDictionary dictionary ];
134
131
_streamHandlers = [NSMutableDictionary dictionary ];
135
132
136
- #if TARGET_OS_IPHONE
137
133
_multiFactorSessionMap = [NSMutableDictionary dictionary ];
138
134
_multiFactorResolverMap = [NSMutableDictionary dictionary ];
139
135
_multiFactorAssertionMap = [NSMutableDictionary dictionary ];
140
136
_multiFactorTotpSecretMap = [NSMutableDictionary dictionary ];
141
-
142
- #endif
143
137
}
144
138
return self;
145
139
}
@@ -164,11 +158,11 @@ + (void)registerWithRegistrar:(NSObject<FlutterPluginRegistrar> *)registrar {
164
158
[registrar addApplicationDelegate: instance];
165
159
SetUpFirebaseAuthHostApi (registrar.messenger , instance);
166
160
SetUpFirebaseAuthUserHostApi (registrar.messenger , instance);
161
+ #endif
167
162
SetUpMultiFactorUserHostApi (registrar.messenger , instance);
168
163
SetUpMultiFactoResolverHostApi (registrar.messenger , instance);
169
164
SetUpMultiFactorTotpHostApi (registrar.messenger , instance);
170
165
SetUpMultiFactorTotpSecretHostApi (registrar.messenger , instance);
171
- #endif
172
166
}
173
167
174
168
+ (FlutterError *)convertToFlutterError : (NSError *)error {
@@ -841,13 +835,11 @@ - (void)ensureAPNSTokenSetting {
841
835
#endif
842
836
}
843
837
844
- #if !TARGET_OS_OSX
845
838
- (FIRMultiFactor *)getAppMultiFactorFromPigeon : (nonnull AuthPigeonFirebaseApp *)app {
846
839
FIRAuth *auth = [self getFIRAuthFromAppNameFromPigeon: app];
847
840
FIRUser *currentUser = auth.currentUser ;
848
841
return currentUser.multiFactor ;
849
842
}
850
- #endif
851
843
852
844
- (nonnull ASPresentationAnchor)presentationAnchorForAuthorizationController :
853
845
(nonnull ASAuthorizationController *)controller API_AVAILABLE(macos(10.15 ), ios(13.0 )) {
@@ -887,6 +879,8 @@ - (void)enrollPhoneApp:(nonnull AuthPigeonFirebaseApp *)app
887
879
}];
888
880
}
889
881
882
+ #endif
883
+
890
884
- (void )getEnrolledFactorsApp : (nonnull AuthPigeonFirebaseApp *)app
891
885
completion : (nonnull void (^)(NSArray <PigeonMultiFactorInfo *> *_Nullable,
892
886
FlutterError *_Nullable))completion {
@@ -965,6 +959,8 @@ - (void)enrollTotpApp:(nonnull AuthPigeonFirebaseApp *)app
965
959
}];
966
960
}
967
961
962
+ #if TARGET_OS_IPHONE
963
+
968
964
- (void )resolveSignInResolverId:(nonnull NSString *)resolverId
969
965
assertion:(nullable PigeonPhoneMultiFactorAssertion *)assertion
970
966
totpAssertionId:(nullable NSString *)totpAssertionId
@@ -1005,6 +1001,8 @@ - (void)resolveSignInResolverId:(nonnull NSString *)resolverId
1005
1001
}];
1006
1002
}
1007
1003
1004
+ #endif
1005
+
1008
1006
- (void )generateSecretSessionId : (nonnull NSString *)sessionId
1009
1007
completion : (nonnull void (^)(PigeonTotpSecret *_Nullable,
1010
1008
FlutterError *_Nullable))completion {
@@ -1071,8 +1069,6 @@ - (void)openInOtpAppSecretKey:(nonnull NSString *)secretKey
1071
1069
completion (nil );
1072
1070
}
1073
1071
1074
- #endif
1075
-
1076
1072
- (void )applyActionCodeApp : (nonnull AuthPigeonFirebaseApp *)app
1077
1073
code : (nonnull NSString *)code
1078
1074
completion : (nonnull void (^)(FlutterError *_Nullable))completion {
0 commit comments