Skip to content

Commit 3be35a5

Browse files
authored
feat(auth): add auth emulator snippets (#410)
1 parent 2583101 commit 3be35a5

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package com.google.firebase.quickstart.auth;
2+
3+
import com.google.firebase.auth.FirebaseAuth;
4+
5+
public class EmulatorSuite {
6+
public void emulatorSettings() {
7+
// [START auth_emulator_connect]
8+
// 10.0.2.2 is the special IP address to connect to the 'localhost' of
9+
// the host computer from an Android emulator.
10+
FirebaseAuth.getInstance().useEmulator("10.0.2.2", 9099);
11+
// [END auth_emulator_connect]
12+
}
13+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package com.google.firebase.quickstart.auth.kotlin
2+
3+
import com.google.firebase.auth.ktx.auth
4+
import com.google.firebase.ktx.Firebase
5+
6+
class EmulatorSuite {
7+
8+
fun emulatorSettings() {
9+
// [START auth_emulator_connect]
10+
// 10.0.2.2 is the special IP address to connect to the 'localhost' of
11+
// the host computer from an Android emulator.
12+
Firebase.auth.useEmulator("10.0.2.2", 9099)
13+
// [END auth_emulator_connect]
14+
}
15+
16+
}

0 commit comments

Comments
 (0)