Skip to content

Commit

Permalink
Added method from cgisca@71496af by
Browse files Browse the repository at this point in the history
DeleteSystem32 to check if Google services are available on device.
  • Loading branch information
oneseedfruit committed Apr 23, 2021
1 parent 70fe523 commit acce3a2
Showing 1 changed file with 8 additions and 0 deletions.
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 @@ -89,6 +91,7 @@ class PlayGameServicesGodot(godot: Godot) : GodotPlugin(godot), AchievementsList

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

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

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

0 comments on commit acce3a2

Please sign in to comment.