2
0
mirror of synced 2025-01-28 23:24:45 +00:00

[ios][auth] add signInWithEmailLink native method

This commit is contained in:
Salakar 2018-05-13 00:37:19 +01:00
parent 4a6f12ec59
commit d0ae75d531

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