Skip to content

Commit

Permalink
Fixes to play games sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
ForceTower committed Apr 19, 2024
1 parent 19d23ed commit 5066dda
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/src/main/java/com/forcetower/uefs/UApplication.kt
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ class UApplication : Application(), Configuration.Provider {
}
super.onCreate()

PlayGamesSdk.initialize(this)
if (preferences.getBoolean("google_play_games_enabled_v2", false)) {
PlayGamesSdk.initialize(this)
}
setupDayNightTheme(this)
defineWorker()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import androidx.activity.result.contract.ActivityResultContracts
import androidx.annotation.StringRes
import com.forcetower.uefs.GooglePlayGamesInstance
import com.forcetower.uefs.R
import com.google.android.gms.games.PlayGamesSdk
import com.google.android.material.snackbar.Snackbar
import kotlinx.coroutines.tasks.await
import timber.log.Timber
Expand Down Expand Up @@ -66,6 +67,7 @@ abstract class UGameActivity : UActivity() {
}

fun signIn() {
PlayGamesSdk.initialize(applicationContext)
val client = mGamesInstance.signInClient
Timber.d("Signing in!")
client.signIn()
Expand Down

0 comments on commit 5066dda

Please sign in to comment.