Skip to content

Commit

Permalink
Revert "fix: Add anonymous Firebase Auth before Firestore initializat…
Browse files Browse the repository at this point in the history
…ion, also add new security rules to firebase project rules"

This reverts commit 6f60727.
  • Loading branch information
milospi committed Apr 13, 2026
1 parent 580dbd4 commit 6e1a354
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 15 deletions.
1 change: 0 additions & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ dependencies {

implementation platform('com.google.firebase:firebase-bom:34.10.0')
implementation 'com.google.firebase:firebase-firestore'
implementation 'com.google.firebase:firebase-auth'

natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-arm64-v8a"
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi-v7a"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

import com.badlogic.gdx.backends.android.AndroidApplication;
import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.firestore.FirebaseFirestore;
import group07.beatbattle.BeatBattle;
import group07.beatbattle.android.firebase.AndroidFirebaseGateway;
Expand All @@ -20,18 +19,12 @@ protected void onCreate(Bundle savedInstanceState) {
AndroidApplicationConfiguration configuration = new AndroidApplicationConfiguration();
configuration.useImmersiveMode = true;

FirebaseAuth.getInstance().signInAnonymously()
.addOnSuccessListener(authResult -> {
FirebaseFirestore firestore = FirebaseFirestore.getInstance();
FirestoreSessionRepository sessionRepository = new FirestoreSessionRepository(firestore);
FirebaseGateway firebaseGateway = new AndroidFirebaseGateway(sessionRepository);
BeatBattle game = new BeatBattle(firebaseGateway);
game.setServices(new DeezerMusicService(), new AndroidAudioPlayer(this));
initialize(game, configuration);
})
.addOnFailureListener(e -> {
// Log and show an error — app can't proceed without auth
android.util.Log.e("AndroidLauncher", "Anonymous sign-in failed: " + e.getMessage());
});
FirebaseFirestore firestore = FirebaseFirestore.getInstance();
FirestoreSessionRepository sessionRepository = new FirestoreSessionRepository(firestore);
FirebaseGateway firebaseGateway = new AndroidFirebaseGateway(sessionRepository);

BeatBattle game = new BeatBattle(firebaseGateway);
game.setServices(new DeezerMusicService(), new AndroidAudioPlayer(this));
initialize(game, configuration);
}
}

0 comments on commit 6e1a354

Please sign in to comment.