Skip to content

Commit

Permalink
fix: merge issue and security rules too strict
Browse files Browse the repository at this point in the history
  • Loading branch information
milospi committed Apr 13, 2026
1 parent 6e1a354 commit 950599f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
1 change: 1 addition & 0 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ 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 @@ -5,6 +5,7 @@
import com.badlogic.gdx.backends.android.AndroidApplication;
import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration;
import com.google.firebase.firestore.FirebaseFirestore;
import com.google.firebase.auth.FirebaseAuth;
import group07.beatbattle.BeatBattle;
import group07.beatbattle.android.firebase.AndroidFirebaseGateway;
import group07.beatbattle.firebase.FirebaseGateway;
Expand All @@ -15,16 +16,23 @@ public class AndroidLauncher extends AndroidApplication {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

AndroidApplicationConfiguration configuration = new AndroidApplicationConfiguration();
configuration.useImmersiveMode = true;

FirebaseFirestore firestore = FirebaseFirestore.getInstance();
FirestoreSessionRepository sessionRepository = new FirestoreSessionRepository(firestore);
FirebaseGateway firebaseGateway = new AndroidFirebaseGateway(sessionRepository);
AndroidFirebaseGateway firebaseGateway = new AndroidFirebaseGateway(sessionRepository);

// Initialize LibGDX immediately so onResume() works
BeatBattle game = new BeatBattle(firebaseGateway);
game.setServices(new DeezerMusicService(), new AndroidAudioPlayer(this));
initialize(game, configuration);

// Sign in anonymously in the background — Firestore calls won't happen
// until the user actually creates/joins a session anyway
FirebaseAuth.getInstance().signInAnonymously()
.addOnFailureListener(e ->
android.util.Log.e("AndroidLauncher", "Anonymous sign-in failed: " + e.getMessage())
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@ public void createSession(
firestore.collection(SESSIONS)
.add(session)
.addOnSuccessListener(docRef -> callback.onSuccess(docRef.getId()))
.addOnFailureListener(callback::onFailure);
.addOnFailureListener(e -> {
android.util.Log.e("Firestore", "createSession failed: " + e.getMessage());
callback.onFailure(e);
});
}

public void addHostToPlayers(
Expand Down

0 comments on commit 950599f

Please sign in to comment.