Skip to content

Commit

Permalink
feat(auth, emulator): implement native useEmulator calls
Browse files Browse the repository at this point in the history
  • Loading branch information
mikehardy committed Nov 15, 2020
1 parent ee3ab5c commit 010d46d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1661,6 +1661,14 @@ public void verifyPasswordResetCode(String appName, String code, final Promise p
});
}

@ReactMethod
public void useEmulator(String appName, String host, int port) {
Log.d(TAG, "useEmulator");
FirebaseApp firebaseApp = FirebaseApp.getInstance(appName);
FirebaseAuth firebaseAuth = FirebaseAuth.getInstance(firebaseApp);
firebaseAuth.useEmulator(host, port);
}

/* ------------------
* INTERNAL HELPERS
* ---------------- */
Expand Down
8 changes: 8 additions & 0 deletions packages/auth/ios/RNFBAuth/RNFBAuthModule.m
Original file line number Diff line number Diff line change
Expand Up @@ -924,6 +924,14 @@ - (void)invalidate {
}];
}

RCT_EXPORT_METHOD(useEmulator:
(FIRApp *) firebaseApp
:(nonnull NSString *)host
:(NSInteger)port
) {
[[FIRAuth authWithApp:firebaseApp] useEmulatorWithHost: host port:port];
}

- (FIRAuthCredential *)getCredentialForProvider:(NSString *)provider token:(NSString *)authToken secret:(NSString *)authTokenSecret {
FIRAuthCredential *credential;

Expand Down

0 comments on commit 010d46d

Please sign in to comment.