forked from cgisca/PGSGP
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated Godot's aar to 3.2.3. Added changes from cgisca#48 by Hamdiov…
…ish.
- Loading branch information
1 parent
a736d0d
commit bdf7ddd
Showing
17 changed files
with
106 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 17 additions & 5 deletions
22
app/src/main/java/io/cgisca/godot/gpgs/ConnectionController.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,34 @@ | ||
package io.cgisca.godot.gpgs | ||
|
||
import android.app.Activity | ||
import android.util.Log | ||
import android.util.Pair | ||
import com.google.android.gms.auth.api.signin.GoogleSignIn | ||
import com.google.android.gms.auth.api.signin.GoogleSignInOptions | ||
import io.cgisca.godot.gpgs.signin.UserProfile | ||
|
||
class ConnectionController( | ||
private val activity: Activity, | ||
private var signInOptions: GoogleSignInOptions | ||
) { | ||
|
||
fun isConnected(): Pair<Boolean, String> { | ||
fun isConnected(): Pair<Boolean, UserProfile> { | ||
val userProfile = UserProfile(null, null, null, null) | ||
val googleSignInAccount = GoogleSignIn.getLastSignedInAccount(activity) | ||
var accId = "" | ||
?: return Pair(false, userProfile) | ||
|
||
googleSignInAccount?.id?.let { | ||
accId = it | ||
if (!googleSignInAccount.isExpired) { | ||
Log.i("godot","Sign in data is valid") | ||
userProfile.let { | ||
it.displayName = googleSignInAccount.displayName | ||
it.email = googleSignInAccount.email | ||
it.token = googleSignInAccount.idToken | ||
it.id = googleSignInAccount.id | ||
} | ||
return Pair(GoogleSignIn.hasPermissions(googleSignInAccount, *signInOptions.scopeArray), userProfile) | ||
}else{ | ||
Log.i("godot","Sign in data has expired") | ||
return Pair(false, userProfile) | ||
} | ||
return Pair(GoogleSignIn.hasPermissions(googleSignInAccount, *signInOptions.scopeArray), accId) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
app/src/main/java/io/cgisca/godot/gpgs/signin/SignInListener.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package io.cgisca.godot.gpgs.signin | ||
|
||
data class UserProfile(var displayName: String?, var email: String?, var token: String?, var id: String?) { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
3.2.2.stable | ||
3.2.3.stable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
configurations.maybeCreate("default") | ||
artifacts.add("default", file('godot-lib.3.2.3.stable.release.aar')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
include ':app', ':godot-lib.3.2.2.stable.release' | ||
include ':app', ':godot-lib.3.2.3.stable.release' |