You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
NOTE: ATM module uses an outdated Google API which Google says to deprecate in not so distant future. Unfortunatly author has no resources to refactor this module using new API (as of now). If YOU wish to do so, your pull-request will be much appreciated and very welcome!
Options:
Custom Package:
- place your apk from build
Permissions on:
- Access Network State
- Internet
Configuring your game
To enable any Android module, add the module package name in the format of path to modules paramter (comma seperated if many) under android(all lower-case) section. You can do so by using Godot project settings GUI, or by editing it directly and appending the below text to your engine.cfg:
Take a look at this page and check if you've got everything setup as described
If you use both debug and release sign keys, than make sure you have two seperate APP entries for each key at Google Play Console > Game Services > Linked Apps
Drive API has to be enabled for the app. To check it go to:
Google Play Console > Game Services > Game details
Scroll down to the bottom of the page to section API Console project and follow the link with your app name
Click ENABLE APIS AND SERVICES find Drive API and enable it
[API reference]
:GENERAL:
Methods
NOTE: debug mode logs method calls and sensitive data, such as ids, use with caution
Method name
Parameters
Returns
Description
init(instance_id)
intinstance_id -- Godot app reference, can be obtained with GDScript's get_intance_ID()
-
Initialize GoogleApiClient
init_with_debug(instance_id)
intinstance_id -- Godot app reference, can be obtained with GDScript's get_intance_ID()
-
Initialize GoogleApiClient with debug mode enabled
set_debug(state)
boolstate
-
Change debug logging state during runtime
:CONNECTION:
Methods
Method name
Parameters
Returns
Description
sign_in()
-
-
Sign in to Google (Play Games) Services
sign_out()
-
-
Sign out of Google (Play Games) Services (technically the same as disconnect)
disconnect()
-
-
Disconnect client of Google (Play Games) Services
reconnect()
-
-
Try to reconnect if connection is lost to Google (Play Games) Services
is_signing_in()
-
bool
Get connection status (is connecting)
is_signed_in()
-
bool
Get connection status (is connected)
is_connection_suspended()
-
bool
Get connection status (is suspended)
Callback events
Callback name
Parameters
Returns
Description
_on_gpgs_connected()
-
-
Callback on successful connection
_on_gpgs_suspended()
-
-
Callback on connection suspended
_on_gpgs_not_connected()
-
-
Callback on any operation when client is not connected
_on_gpgs_not_signed_in()
-
-
Callback on any operation when client is not signed in
Stringleaderboard_id -- leaderboard id obtained from your Developer Console; intscore -- score number the player earned; Stringstatus -- status returned. "STATUS_OK" in case of success
-
Callback on leaderboard_score_submitted_immediate
_on_all_leaderboards_closed()
-
-
Callback on all leaderboard list closed by user
_on_leaderboard_closed()
-
-
Callback on specific leaderboard (opened with leaderboard_show or leaderboard_show_with_time_span closed by user
:ACHIEVEMNTS:
Methods
Method name
Parameters
Returns
Description
achievement_show_list()
-
-
Show achievements list
achievement_unlock(achievement_id)
Stringachievement_id -- achievement id obtained from your Developer Console
-
Unlock an achievement with a given id
achievement_unlock_immediate(achievement_id)
Stringachievement_id -- achievement id obtained from your Developer Console
-
Unlock an achievement with a given id immediately with a callback result
achievement_reveal(achievement_id)
Stringachievement_id -- achievement id obtained from your Developer Console
-
Reveal a hidden achievement with a given id
achievement_reveal_immediate(achievement_id)
Stringachievement_id -- achievement id obtained from your Developer Console
-
Reveal a hidden achievement with a given id immediately with a callback result
Stringachievement_id -- achievement_id achievement id obtained from your Developer Console; intincrement_amount -- ammount of points to increment the achievement by
-
Increment an achievement with a given id by a given amount of points
Stringachievement_id -- achievement_id achievement id obtained from your Developer Console; intincrement_amount -- ammount of points to increment the achievement by
-
Increment an achievement with a given id by a given amount of points immediately with a callback result
Callback events
Callback name
Parameters
Returns
Description
_on_achievements_closed()
-
-
Callback on achievements list closed by user
_on_achievement_unlocked()
Stringachievement_id -- achievement_id achievement id obtained from your Developer Console; Stringstatus -- status returned. "STATUS_OK" in case of success
-
Callback on achievement unlocked (immediate)
_on_achievement_revealed()
Stringachievement_id -- achievement_id achievement id obtained from your Developer Console; Stringstatus -- status returned. "STATUS_OK" in case of success
-
Callback on achievement revealed (immediate)
_on_achievement_incremented()
Stringachievement_id -- achievement_id achievement id obtained from your Developer Console; intincrement_amount -- increment_amount ammount of points to increment the achievement by; Stringstatus -- status returned. "STATUS_OK" in case of success
-
Callback on achievement unlocked (immediate)
:PLAYER INFO:
Methods
NOTE: If player info failed to load then every method will return an empty string
Method name
Parameters
Returns
Description
is_player_info_available()
-
booleanplayer_info_available
Returns availability status of Google Play Game Service player info data
update_player_info()
-
-
Update/download player info data from Google Play Game Services
get_player_id()
-
Stringplayer_id
Get player ID
get_player_display_name()
-
Stringplayer_display_name -- e.g. Ed Boon
Get a player Display Name
get_player_title()
-
Stringplayer_title -- e.g. n00b
Get player Title
get_player_icon_image_uri()
-
Stringplayer_icon_image_uri
Get URI of Player's Icon Image if player info is loaded
get_player_current_level_number()
-
intplayer_level_number -- current level number or -1
Get Player's Current Level if player info is loaded
Callback events
Callback name
Parameters
Returns
Description
_on_player_info_update()
-
-
Callback on player info data loaded from Google Play Game Services