@react-native-firebase/auth 21.3.0 → 21.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/RNFBAuth.podspec +2 -0
- package/ios/RNFBAuth/RNFBAuthModule.m +26 -1
- package/lib/version.js +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
@@ -3,6 +3,16 @@
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
5
5
|
|
6
|
+
## [21.4.0](https://github.com/invertase/react-native-firebase/compare/v21.3.0...v21.4.0) (2024-11-07)
|
7
|
+
|
8
|
+
### Features
|
9
|
+
|
10
|
+
- Add initial tvOS support to some firebase packages ([ca51b51](https://github.com/invertase/react-native-firebase/commit/ca51b51f86edb9a5e293b463491fad40e4189e53))
|
11
|
+
|
12
|
+
### Bug Fixes
|
13
|
+
|
14
|
+
- **auth, tvOS:** guard all phone & MFA with iOS-only compile ifdef ([3691bd0](https://github.com/invertase/react-native-firebase/commit/3691bd0c299fcd78ae58908ed5825e9c190714ed))
|
15
|
+
|
6
16
|
## [21.3.0](https://github.com/invertase/react-native-firebase/compare/v21.2.0...v21.3.0) (2024-10-31)
|
7
17
|
|
8
18
|
**Note:** Version bump only for package @react-native-firebase/auth
|
package/RNFBAuth.podspec
CHANGED
@@ -10,6 +10,7 @@ if coreVersionDetected != coreVersionRequired
|
|
10
10
|
end
|
11
11
|
firebase_ios_target = appPackage['sdkVersions']['ios']['iosTarget']
|
12
12
|
firebase_macos_target = appPackage['sdkVersions']['ios']['macosTarget']
|
13
|
+
firebase_tvos_target = appPackage['sdkVersions']['ios']['tvosTarget']
|
13
14
|
|
14
15
|
Pod::Spec.new do |s|
|
15
16
|
s.name = "RNFBAuth"
|
@@ -25,6 +26,7 @@ Pod::Spec.new do |s|
|
|
25
26
|
s.social_media_url = 'http://twitter.com/invertaseio'
|
26
27
|
s.ios.deployment_target = firebase_ios_target
|
27
28
|
s.macos.deployment_target = firebase_macos_target
|
29
|
+
s.tvos.deployment_target = firebase_tvos_target
|
28
30
|
s.source_files = 'ios/**/*.{h,m}'
|
29
31
|
|
30
32
|
# React Native dependencies
|
@@ -55,8 +55,10 @@ static __strong NSMutableDictionary *idTokenHandlers;
|
|
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_IOS
|
58
59
|
static __strong NSMutableDictionary<NSString *, FIRMultiFactorResolver *> *cachedResolver;
|
59
60
|
static __strong NSMutableDictionary<NSString *, FIRMultiFactorSession *> *cachedSessions;
|
61
|
+
#endif
|
60
62
|
|
61
63
|
@implementation RNFBAuthModule
|
62
64
|
#pragma mark -
|
@@ -76,8 +78,10 @@ RCT_EXPORT_MODULE();
|
|
76
78
|
idTokenHandlers = [[NSMutableDictionary alloc] init];
|
77
79
|
emulatorConfigs = [[NSMutableDictionary alloc] init];
|
78
80
|
credentials = [[NSMutableDictionary alloc] init];
|
81
|
+
#if TARGET_OS_IOS
|
79
82
|
cachedResolver = [[NSMutableDictionary alloc] init];
|
80
83
|
cachedSessions = [[NSMutableDictionary alloc] init];
|
84
|
+
#endif
|
81
85
|
});
|
82
86
|
return self;
|
83
87
|
}
|
@@ -103,8 +107,10 @@ RCT_EXPORT_MODULE();
|
|
103
107
|
[idTokenHandlers removeAllObjects];
|
104
108
|
|
105
109
|
[credentials removeAllObjects];
|
110
|
+
#if TARGET_OS_IOS
|
106
111
|
[cachedResolver removeAllObjects];
|
107
112
|
[cachedSessions removeAllObjects];
|
113
|
+
#endif
|
108
114
|
}
|
109
115
|
|
110
116
|
#pragma mark -
|
@@ -415,6 +421,7 @@ RCT_EXPORT_METHOD(updatePassword
|
|
415
421
|
}
|
416
422
|
}
|
417
423
|
|
424
|
+
#if TARGET_OS_IOS
|
418
425
|
RCT_EXPORT_METHOD(updatePhoneNumber
|
419
426
|
: (FIRApp *)firebaseApp
|
420
427
|
: (NSString *)provider
|
@@ -455,6 +462,7 @@ RCT_EXPORT_METHOD(updatePhoneNumber
|
|
455
462
|
[self promiseNoUser:resolve rejecter:reject isError:YES];
|
456
463
|
}
|
457
464
|
}
|
465
|
+
#endif
|
458
466
|
|
459
467
|
RCT_EXPORT_METHOD(updateProfile
|
460
468
|
: (FIRApp *)firebaseApp
|
@@ -617,6 +625,7 @@ RCT_EXPORT_METHOD(signInWithProvider
|
|
617
625
|
[builder setCustomParameters:provider[@"customParameters"]];
|
618
626
|
}
|
619
627
|
|
628
|
+
#if TARGET_OS_IOS
|
620
629
|
[builder getCredentialWithUIDelegate:nil
|
621
630
|
completion:^(FIRAuthCredential *_Nullable credential,
|
622
631
|
NSError *_Nullable error) {
|
@@ -647,6 +656,7 @@ RCT_EXPORT_METHOD(signInWithProvider
|
|
647
656
|
}];
|
648
657
|
}
|
649
658
|
}];
|
659
|
+
#endif
|
650
660
|
}
|
651
661
|
|
652
662
|
RCT_EXPORT_METHOD(confirmPasswordReset
|
@@ -817,6 +827,7 @@ RCT_EXPORT_METHOD(signInWithCustomToken
|
|
817
827
|
}];
|
818
828
|
}
|
819
829
|
|
830
|
+
#if TARGET_OS_IOS
|
820
831
|
RCT_EXPORT_METHOD(signInWithPhoneNumber
|
821
832
|
: (FIRApp *)firebaseApp
|
822
833
|
: (NSString *)phoneNumber
|
@@ -1053,6 +1064,7 @@ RCT_EXPORT_METHOD(confirmationResultConfirm
|
|
1053
1064
|
}
|
1054
1065
|
}];
|
1055
1066
|
}
|
1067
|
+
#endif
|
1056
1068
|
|
1057
1069
|
RCT_EXPORT_METHOD(linkWithCredential
|
1058
1070
|
: (FIRApp *)firebaseApp
|
@@ -1122,6 +1134,7 @@ RCT_EXPORT_METHOD(linkWithProvider
|
|
1122
1134
|
[builder setCustomParameters:provider[@"parameters"]];
|
1123
1135
|
}
|
1124
1136
|
|
1137
|
+
#if TARGET_OS_IOS
|
1125
1138
|
[builder getCredentialWithUIDelegate:nil
|
1126
1139
|
completion:^(FIRAuthCredential *_Nullable credential,
|
1127
1140
|
NSError *_Nullable error) {
|
@@ -1151,6 +1164,7 @@ RCT_EXPORT_METHOD(linkWithProvider
|
|
1151
1164
|
}];
|
1152
1165
|
}
|
1153
1166
|
}];
|
1167
|
+
#endif
|
1154
1168
|
}
|
1155
1169
|
|
1156
1170
|
RCT_EXPORT_METHOD(unlink
|
@@ -1248,7 +1262,7 @@ RCT_EXPORT_METHOD(reauthenticateWithProvider
|
|
1248
1262
|
if (provider[@"parameters"]) {
|
1249
1263
|
[builder setCustomParameters:provider[@"parameters"]];
|
1250
1264
|
}
|
1251
|
-
|
1265
|
+
#if TARGET_OS_IOS
|
1252
1266
|
[builder getCredentialWithUIDelegate:nil
|
1253
1267
|
completion:^(FIRAuthCredential *_Nullable credential,
|
1254
1268
|
NSError *_Nullable error) {
|
@@ -1279,6 +1293,7 @@ RCT_EXPORT_METHOD(reauthenticateWithProvider
|
|
1279
1293
|
}];
|
1280
1294
|
}
|
1281
1295
|
}];
|
1296
|
+
#endif
|
1282
1297
|
}
|
1283
1298
|
|
1284
1299
|
RCT_EXPORT_METHOD(fetchSignInMethodsForEmail
|
@@ -1375,10 +1390,12 @@ RCT_EXPORT_METHOD(useEmulator
|
|
1375
1390
|
} else if ([provider compare:@"github.com" options:NSCaseInsensitiveSearch] == NSOrderedSame) {
|
1376
1391
|
credential = [FIRGitHubAuthProvider credentialWithToken:authToken];
|
1377
1392
|
} else if ([provider compare:@"phone" options:NSCaseInsensitiveSearch] == NSOrderedSame) {
|
1393
|
+
#if TARGET_OS_IOS
|
1378
1394
|
DLog(@"using app credGen: %@", firebaseApp.name) credential =
|
1379
1395
|
[[FIRPhoneAuthProvider providerWithAuth:[FIRAuth authWithApp:firebaseApp]]
|
1380
1396
|
credentialWithVerificationID:authToken
|
1381
1397
|
verificationCode:authTokenSecret];
|
1398
|
+
#endif
|
1382
1399
|
} else if ([provider compare:@"oauth" options:NSCaseInsensitiveSearch] == NSOrderedSame) {
|
1383
1400
|
credential = [FIROAuthProvider credentialWithProviderID:@"oauth"
|
1384
1401
|
IDToken:authToken
|
@@ -1423,6 +1440,7 @@ RCT_EXPORT_METHOD(useEmulator
|
|
1423
1440
|
}
|
1424
1441
|
}
|
1425
1442
|
|
1443
|
+
#if TARGET_OS_IOS
|
1426
1444
|
- (NSDictionary *)multiFactorResolverToDict:(FIRMultiFactorResolver *)resolver {
|
1427
1445
|
// Temporarily store the non-serializable session for later
|
1428
1446
|
NSString *sessionHash = [NSString stringWithFormat:@"%@", @([resolver.session hash])];
|
@@ -1433,6 +1451,7 @@ RCT_EXPORT_METHOD(useEmulator
|
|
1433
1451
|
@"auth" : resolver.auth
|
1434
1452
|
};
|
1435
1453
|
}
|
1454
|
+
#endif
|
1436
1455
|
|
1437
1456
|
- (NSString *)getJSFactorId:(NSString *)factorId {
|
1438
1457
|
if ([factorId isEqualToString:@"1"]) {
|
@@ -1543,6 +1562,7 @@ RCT_EXPORT_METHOD(useEmulator
|
|
1543
1562
|
}
|
1544
1563
|
|
1545
1564
|
NSDictionary *resolverDict = nil;
|
1565
|
+
#if TARGET_OS_IOS
|
1546
1566
|
if ([error userInfo][FIRAuthErrorUserInfoMultiFactorResolverKey] != nil) {
|
1547
1567
|
FIRMultiFactorResolver *resolver = error.userInfo[FIRAuthErrorUserInfoMultiFactorResolverKey];
|
1548
1568
|
resolverDict = [self multiFactorResolverToDict:resolver];
|
@@ -1550,6 +1570,7 @@ RCT_EXPORT_METHOD(useEmulator
|
|
1550
1570
|
NSString *sessionKey = [NSString stringWithFormat:@"%@", @([resolver.session hash])];
|
1551
1571
|
cachedResolver[sessionKey] = resolver;
|
1552
1572
|
}
|
1573
|
+
#endif
|
1553
1574
|
|
1554
1575
|
return @{
|
1555
1576
|
@"code" : code,
|
@@ -1696,11 +1717,14 @@ RCT_EXPORT_METHOD(useEmulator
|
|
1696
1717
|
@"refreshToken" : user.refreshToken,
|
1697
1718
|
@"tenantId" : user.tenantID ? (id)user.tenantID : [NSNull null],
|
1698
1719
|
keyUid : user.uid,
|
1720
|
+
#if TARGET_OS_IOS
|
1699
1721
|
@"multiFactor" :
|
1700
1722
|
@{@"enrolledFactors" : [self convertMultiFactorData:user.multiFactor.enrolledFactors]}
|
1723
|
+
#endif
|
1701
1724
|
};
|
1702
1725
|
}
|
1703
1726
|
|
1727
|
+
#if TARGET_OS_IOS
|
1704
1728
|
- (NSArray<NSMutableDictionary *> *)convertMultiFactorData:(NSArray<FIRMultiFactorInfo *> *)hints {
|
1705
1729
|
NSMutableArray *enrolledFactors = [NSMutableArray array];
|
1706
1730
|
|
@@ -1720,6 +1744,7 @@ RCT_EXPORT_METHOD(useEmulator
|
|
1720
1744
|
}
|
1721
1745
|
return enrolledFactors;
|
1722
1746
|
}
|
1747
|
+
#endif
|
1723
1748
|
|
1724
1749
|
- (NSDictionary *)authCredentialToDict:(FIRAuthCredential *)authCredential {
|
1725
1750
|
NSString *authCredentialHash = [NSString stringWithFormat:@"%@", @([authCredential hash])];
|
package/lib/version.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
// Generated by genversion.
|
2
|
-
module.exports = '21.
|
2
|
+
module.exports = '21.4.0';
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@react-native-firebase/auth",
|
3
|
-
"version": "21.
|
3
|
+
"version": "21.4.0",
|
4
4
|
"author": "Invertase <oss@invertase.io> (http://invertase.io)",
|
5
5
|
"description": "React Native Firebase - The authentication module provides an easy-to-use API to integrate an authentication workflow into new and existing applications. React Native Firebase provides access to all Firebase authentication methods and identity providers.",
|
6
6
|
"main": "lib/index.js",
|
@@ -27,7 +27,7 @@
|
|
27
27
|
"plist": "^3.1.0"
|
28
28
|
},
|
29
29
|
"peerDependencies": {
|
30
|
-
"@react-native-firebase/app": "21.
|
30
|
+
"@react-native-firebase/app": "21.4.0",
|
31
31
|
"expo": ">=47.0.0"
|
32
32
|
},
|
33
33
|
"devDependencies": {
|
@@ -42,5 +42,5 @@
|
|
42
42
|
"publishConfig": {
|
43
43
|
"access": "public"
|
44
44
|
},
|
45
|
-
"gitHead": "
|
45
|
+
"gitHead": "227e1ed54cf668cbc701c0ed2542b8ec66957e1e"
|
46
46
|
}
|