Skip to content

Google play service, login, achievements, leaderboard, attempt to fix module for Godot 3.1

License

Notifications You must be signed in to change notification settings

AngeloGi/GodotGoogleService

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Godot GoogleService

GodotGoogleService is a google play games integration for godot android;

  • Note for this Fork: This fork was created to help other Godot developers get their games into Google Play, as no other version we've tried helped. It is tested working on Godot v3.1.

Platform GodotEngine LICENCE PATREON

Depends on

Godot game engine: git clone https://github.com/godotengine/godot

Available Features

Login

Logout

Achievements

Leaderboard

Build/Compile module

  • Edit file modules/GodotGoogleService/config.py at line 2
p_app_id = "com.your.appid"     # config.py L:2
  • Replay com.your.appid with you android application id.

Initialize GodotGoogleService

Edit engine.cfg and add

[android]
modules="org/godotengine/godot/GooglePlay"

GDScript - getting module singleton and initializing;

On 2.X

var google = Globals.get_singleton("GooglePlay");

On 3.X (latest from git)

var google = Engine.get_singleton("GooglePlay");

And initialize GodotGoogleService with script instance id

func _ready():
	if OS.get_name() == "Android":
		google.init(get_instance_ID()) # use get_instance_id () for Godot 3.X

func _receive_message(from, key, data):
	if from == "GooglePlay":
		print("Key: ", key, " Data: ", data)

Google Play Service Sign In / Sign Out

google.login()
google.logout()

Google Play Achievements

google.unlock_achievement("achievementID") # unlock achievement;
google.increse_achievement("achievementID", int(n)) # increse achievements by step.
google.show_achievements() # show achievements;

Google play Leaderboards

google.submit_leaderboard(int(score), "leaderboardID") # submit score to leaderboard
google.show_leaderboard("leaderboardID") # show leaderboard
google.show_leaderboards() # show all available leaderboard

Additional

google.get_version_code() # get package version code (Helper)

Log Event

adb -d logcat godot:V GoogleService:V SignInIntentService:V SignInIntentService:V SignInActivity:V DEBUG:V AndroidRuntime:V ValidateServiceOp:V *:S

About

Google play service, login, achievements, leaderboard, attempt to fix module for Godot 3.1

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages

  • Java 97.1%
  • Python 2.9%