[ios] change convertProviderData to use a for in statement

This commit is contained in:
Salakar 2017-05-12 13:58:16 +01:00
parent d9035e9515
commit 06d20cac5c
1 changed files with 4 additions and 6 deletions

View File

@ -643,11 +643,9 @@ RCT_EXPORT_METHOD(reauthenticate:(NSString *)provider authToken:(NSString *)auth
@return NSArray
*/
- (NSArray <NSObject *> *) convertProviderData:(NSArray <id<FIRUserInfo>> *) providerData {
NSEnumerator *items = [providerData objectEnumerator];
NSMutableArray *output = [NSMutableArray array];
id<FIRUserInfo> userInfo;
while (userInfo = [items nextObject]) {
for (id<FIRUserInfo> userInfo in providerData) {
[output addObject:@{
@"providerId": userInfo.providerID,
@"uid": userInfo.uid,
@ -677,8 +675,8 @@ RCT_EXPORT_METHOD(reauthenticate:(NSString *)provider authToken:(NSString *)auth
@"refreshToken": user.refreshToken,
@"providerId": [user.providerID lowercaseString],
@"providerData": [self convertProviderData: user.providerData]
} mutableCopy
];
} mutableCopy
];
if ([user valueForKey:@"photoURL"] != nil) {
[userDict setValue: [NSString stringWithFormat:@"%@", user.photoURL] forKey:@"photoURL"];