55
55
static __strong NSMutableDictionary *emulatorConfigs;
56
56
// Used for caching credentials between method calls.
57
57
static __strong NSMutableDictionary <NSString *, FIRAuthCredential *> *credentials;
58
- #if !TARGET_OS_TV
58
+ #if TARGET_OS_IOS
59
59
static __strong NSMutableDictionary <NSString *, FIRMultiFactorResolver *> *cachedResolver;
60
60
static __strong NSMutableDictionary <NSString *, FIRMultiFactorSession *> *cachedSessions;
61
61
#endif
@@ -78,7 +78,7 @@ - (id)init {
78
78
idTokenHandlers = [[NSMutableDictionary alloc ] init ];
79
79
emulatorConfigs = [[NSMutableDictionary alloc ] init ];
80
80
credentials = [[NSMutableDictionary alloc ] init ];
81
- #if !TARGET_OS_TV
81
+ #if TARGET_OS_IOS
82
82
cachedResolver = [[NSMutableDictionary alloc ] init ];
83
83
cachedSessions = [[NSMutableDictionary alloc ] init ];
84
84
#endif
@@ -107,7 +107,7 @@ - (void)invalidate {
107
107
[idTokenHandlers removeAllObjects ];
108
108
109
109
[credentials removeAllObjects ];
110
- #if !TARGET_OS_TV
110
+ #if TARGET_OS_IOS
111
111
[cachedResolver removeAllObjects ];
112
112
[cachedSessions removeAllObjects ];
113
113
#endif
@@ -421,7 +421,7 @@ - (void)invalidate {
421
421
}
422
422
}
423
423
424
- #if !TARGET_OS_TV
424
+ #if TARGET_OS_IOS
425
425
RCT_EXPORT_METHOD (updatePhoneNumber
426
426
: (FIRApp *)firebaseApp
427
427
: (NSString *)provider
@@ -625,7 +625,7 @@ - (void)invalidate {
625
625
[builder setCustomParameters: provider[@" customParameters" ]];
626
626
}
627
627
628
- #if !TARGET_OS_TV
628
+ #if TARGET_OS_IOS
629
629
[builder getCredentialWithUIDelegate: nil
630
630
completion: ^(FIRAuthCredential *_Nullable credential,
631
631
NSError *_Nullable error) {
@@ -827,7 +827,7 @@ - (void)invalidate {
827
827
}];
828
828
}
829
829
830
- #if !TARGET_OS_TV
830
+ #if TARGET_OS_IOS
831
831
RCT_EXPORT_METHOD (signInWithPhoneNumber
832
832
: (FIRApp *)firebaseApp
833
833
: (NSString *)phoneNumber
@@ -1134,7 +1134,7 @@ - (void)invalidate {
1134
1134
[builder setCustomParameters: provider[@" parameters" ]];
1135
1135
}
1136
1136
1137
- #if !TARGET_OS_TV
1137
+ #if TARGET_OS_IOS
1138
1138
[builder getCredentialWithUIDelegate: nil
1139
1139
completion: ^(FIRAuthCredential *_Nullable credential,
1140
1140
NSError *_Nullable error) {
@@ -1262,7 +1262,7 @@ - (void)invalidate {
1262
1262
if (provider[@" parameters" ]) {
1263
1263
[builder setCustomParameters: provider[@" parameters" ]];
1264
1264
}
1265
- #if !TARGET_OS_TV
1265
+ #if TARGET_OS_IOS
1266
1266
[builder getCredentialWithUIDelegate: nil
1267
1267
completion: ^(FIRAuthCredential *_Nullable credential,
1268
1268
NSError *_Nullable error) {
@@ -1390,7 +1390,7 @@ - (FIRAuthCredential *)getCredentialForProvider:(NSString *)provider
1390
1390
} else if ([provider compare: @" github.com" options: NSCaseInsensitiveSearch] == NSOrderedSame) {
1391
1391
credential = [FIRGitHubAuthProvider credentialWithToken: authToken];
1392
1392
} else if ([provider compare: @" phone" options: NSCaseInsensitiveSearch] == NSOrderedSame) {
1393
- #if !TARGET_OS_TV
1393
+ #if TARGET_OS_IOS
1394
1394
DLog (@" using app credGen: %@ " , firebaseApp.name ) credential =
1395
1395
[[FIRPhoneAuthProvider providerWithAuth: [FIRAuth authWithApp: firebaseApp]]
1396
1396
credentialWithVerificationID: authToken
@@ -1440,7 +1440,7 @@ - (void)promiseNoUser:(RCTPromiseResolveBlock)resolve
1440
1440
}
1441
1441
}
1442
1442
1443
- #if !TARGET_OS_TV
1443
+ #if TARGET_OS_IOS
1444
1444
- (NSDictionary *)multiFactorResolverToDict : (FIRMultiFactorResolver *)resolver {
1445
1445
// Temporarily store the non-serializable session for later
1446
1446
NSString *sessionHash = [NSString stringWithFormat: @" %@ " , @([resolver.session hash ])];
@@ -1563,7 +1563,7 @@ - (NSDictionary *)getJSError:(NSError *)error {
1563
1563
1564
1564
1565
1565
NSDictionary *resolverDict = nil ;
1566
- #if !TARGET_OS_TV
1566
+ #if TARGET_OS_IOS
1567
1567
if ([error userInfo ][FIRAuthErrorUserInfoMultiFactorResolverKey] != nil ) {
1568
1568
FIRMultiFactorResolver *resolver = error.userInfo [FIRAuthErrorUserInfoMultiFactorResolverKey];
1569
1569
resolverDict = [self multiFactorResolverToDict: resolver];
@@ -1718,14 +1718,14 @@ - (NSDictionary *)firebaseUserToDict:(FIRUser *)user {
1718
1718
@" refreshToken" : user.refreshToken ,
1719
1719
@" tenantId" : user.tenantID ? (id )user.tenantID : [NSNull null ],
1720
1720
keyUid : user.uid ,
1721
- #if !TARGET_OS_TV
1721
+ #if TARGET_OS_IOS
1722
1722
@" multiFactor" :
1723
1723
@{@" enrolledFactors" : [self convertMultiFactorData: user.multiFactor.enrolledFactors]}
1724
1724
#endif
1725
1725
};
1726
1726
}
1727
1727
1728
- #if !TARGET_OS_TV
1728
+ #if TARGET_OS_IOS
1729
1729
- (NSArray <NSMutableDictionary *> *)convertMultiFactorData : (NSArray <FIRMultiFactorInfo *> *)hints {
1730
1730
NSMutableArray *enrolledFactors = [NSMutableArray array ];
1731
1731
0 commit comments