@@ -1730,22 +1730,24 @@ - (NSDictionary *)firebaseUserToDict:(FIRUser *)user {
1730
1730
NSMutableArray *enrolledFactors = [NSMutableArray array ];
1731
1731
1732
1732
for (FIRMultiFactorInfo *hint in hints) {
1733
- // only support phone mutli factor
1734
- if ([hint isKindOfClass: [FIRPhoneMultiFactorInfo class ]]) {
1735
- FIRPhoneMultiFactorInfo *phoneHint = (FIRPhoneMultiFactorInfo *)hint;
1736
-
1737
1733
NSString *enrollmentTime =
1738
- [[[NSISO8601DateFormatter alloc ] init ] stringFromDate: phoneHint.enrollmentDate];
1739
- [enrolledFactors addObject: @{
1740
- @" uid" : phoneHint.UID ,
1741
- @" factorId" : FIRPhoneMultiFactorInfo.FIRPhoneMultiFactorID ,
1742
- @" displayName" : phoneHint.displayName == nil ? [NSNull null ] : phoneHint.displayName ,
1734
+ [[[NSISO8601DateFormatter alloc ] init ] stringFromDate: hint.enrollmentDate];
1735
+
1736
+ NSMutableDictionary *factorDict = [@{
1737
+ @" uid" : hint.UID ,
1738
+ @" factorId" : hint.factorID ,
1739
+ @" displayName" : hint.displayName == nil ? [NSNull null ] : hint.displayName ,
1743
1740
@" enrollmentTime" : enrollmentTime,
1744
1741
// @deprecated enrollmentDate kept for backwards compatibility, please use enrollmentTime
1745
1742
@" enrollmentDate" : enrollmentTime,
1746
- @" phoneNumber" : phoneHint.phoneNumber ,
1747
- }];
1748
- }
1743
+ } mutableCopy];
1744
+
1745
+ // only support phone mutli factor
1746
+ if ([hint isKindOfClass: [FIRPhoneMultiFactorInfo class ]]) {
1747
+ FIRPhoneMultiFactorInfo *phoneHint = (FIRPhoneMultiFactorInfo *)hint;
1748
+ factorDict[@" phoneNumber" ] = phoneHint.phoneNumber ;
1749
+ [enrolledFactors addObject: factorDict];
1750
+ }
1749
1751
}
1750
1752
return enrolledFactors;
1751
1753
}
0 commit comments