All-in-One Solution for Indie Game Development · Empowering Indie Developers' Dreams
Documentation · Quick Start · QQ Group: 467608841 / 233840761
Game Frame X Google Login is a Google login component for the GameFrameX framework, providing initialization, login, and logout capabilities.
Choose one of the following methods:
-
Edit your Unity project's
Packages/manifest.jsonand add thescopedRegistriessection:{ "scopedRegistries": [ { "name": "GameFrameX", "url": "https://gameframex.upm.alianblank.uk", "scopes": [ "com.gameframex" ] } ], "dependencies": { "com.gameframex.unity.login.google": "1.1.0" } }scopescontrols which packages are resolved through this registry. Only packages whose names start withcom.gameframexwill be fetched from it. -
Add to
manifest.jsondependencies:{ "com.gameframex.unity.login.google": "https://github.com/gameframex/com.gameframex.unity.login.google.git" } -
Use Package Manager in Unity with Git URL:
https://github.com/gameframex/com.gameframex.unity.login.google.git -
Clone the repository into your Unity project's
Packagesdirectory. It will be loaded automatically.
- Attach the
GoogleLoginComponentcomponent to theGameEntrygame object. - Set the
ProjectIdon theGoogleLoginComponentcomponent. - Call the methods:
// Get Google login component
var googleLoginComponent = GameEntry.GetComponent<GoogleLoginComponent>();
// Initialize
googleLoginComponent.Init();
// Login
googleLoginComponent.Login(
(googleLoginSuccess) =>
{
Debug.Log($"Login successful! {JsonUtility.ToJson(googleLoginSuccess)}");
},
(code) =>
{
Debug.LogError($"Login failed! {code}");
});
// Logout
googleLoginComponent.LogOut();-
Add the
game_services_project_idstring resource inres/values/strings.xml:<?xml version="1.0" encoding="utf-8"?> <resources> <string name="game_services_project_id">YOUR_PROJECT_ID</string> </resources>
-
Add
meta-datain theapplicationnode ofAndroidManifest.xml:<meta-data android:name="com.google.android.gms.games.APP_ID" android:value="@string/game_services_project_id"/>
-
Add library references in
build.gradle:implementation 'com.google.android.gms:play-services-games-v2:+' implementation 'com.google.android.gms:play-services-auth:19.0.0'
com.gameframex.unity: GameFrameX core frameworkcom.gameframex.unity.getchannel: Channel management
- Documentation: https://gameframex.doc.alianblank.com
- Repository: https://github.com/GameFrameX/com.gameframex.unity.login.google
- Issues: https://github.com/GameFrameX/com.gameframex.unity.login.google/issues
- QQ Group: 467608841 / 233840761
See Releases for changelog.
See LICENSE.md for license information.