[ios][auth] add signInWithEmailLink native method

This commit is contained in:
Salakar 2018-05-13 00:37:19 +01:00
parent 4a6f12ec59
commit d0ae75d531
1 changed files with 25 additions and 0 deletions

View File

@ -210,6 +210,31 @@ RCT_EXPORT_METHOD(signInAndRetrieveDataWithEmailAndPassword:(NSString *) appDisp
}];
}
/**
signInWithEmailLink
@param NSString NSString email
@param NSString NSString emailLink
@param RCTPromiseResolveBlock resolve
@param RCTPromiseRejectBlock reject
@return return
*/
RCT_EXPORT_METHOD(signInWithEmailLink:(NSString *) appDisplayName
email:(NSString *) email
emailLink:(NSString *) emailLink
resolver:(RCTPromiseResolveBlock) resolve
rejecter:(RCTPromiseRejectBlock) reject) {
FIRApp *firApp = [RNFirebaseUtil getApp:appDisplayName];
[[FIRAuth authWithApp:firApp] signInWithEmail:email link:emailLink completion:^(FIRAuthDataResult *authResult, NSError *error) {
if (error) {
[self promiseRejectAuthException:reject error:error];
} else {
[self promiseWithAuthResult:resolve rejecter:reject authResult:authResult];
}
}];
}
/**
createUserWithEmailAndPassword