Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ package io.cgisca.godot.gpgs

import android.app.Activity
import android.content.Intent
import com.google.android.gms.common.GoogleApiAvailability
import com.google.android.gms.common.ConnectionResult
import com.google.android.gms.auth.api.Auth
import com.google.android.gms.auth.api.signin.GoogleSignIn
import com.google.android.gms.auth.api.signin.GoogleSignInClient
Expand Down Expand Up @@ -86,6 +88,7 @@ class PlayGameServicesGodot(godot: Godot) : GodotPlugin(godot), AchievementsList

override fun getPluginMethods(): MutableList<String> {
return mutableListOf(
"isGooglePlayServicesAvailable",
"init",
"initWithSavedGames",
"signIn",
Expand Down Expand Up @@ -164,6 +167,11 @@ class PlayGameServicesGodot(godot: Godot) : GodotPlugin(godot), AchievementsList
}
}

fun isGooglePlayServicesAvailable() : Boolean {
val result: Int = GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(godot as Activity)
return result == ConnectionResult.SUCCESS
}

fun init(enablePopups: Boolean) {
initialize(false, enablePopups, "DefaultGame")
}
Expand Down