Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Game Frame X Logo

Game Frame X Google Login

License Version Unity Version Documentation

All-in-One Solution for Indie Game Development · Empowering Indie Developers' Dreams


Documentation · Quick Start · QQ Group: 467608841 / 233840761


English | 简体中文 | 繁體中文 | 日本語 | 한국어

Project Overview

Game Frame X Google Login is a Google login component for the GameFrameX framework, providing initialization, login, and logout capabilities.

Quick Start

Installation

Choose one of the following methods:

  1. Edit your Unity project's Packages/manifest.json and add the scopedRegistries section:

    {
      "scopedRegistries": [
        {
          "name": "GameFrameX",
          "url": "https://gameframex.upm.alianblank.uk",
          "scopes": [
            "com.gameframex"
          ]
        }
      ],
      "dependencies": {
        "com.gameframex.unity.login.google": "1.1.0"
      }
    }

    scopes controls which packages are resolved through this registry. Only packages whose names start with com.gameframex will be fetched from it.

  2. Add to manifest.json dependencies:

    {
       "com.gameframex.unity.login.google": "https://github.com/gameframex/com.gameframex.unity.login.google.git"
    }
  3. Use Package Manager in Unity with Git URL: https://github.com/gameframex/com.gameframex.unity.login.google.git

  4. Clone the repository into your Unity project's Packages directory. It will be loaded automatically.

Usage Examples

  1. Attach the GoogleLoginComponent component to the GameEntry game object.
  2. Set the ProjectId on the GoogleLoginComponent component.
  3. 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();

Platform Configuration

Android

  1. Add the game_services_project_id string resource in res/values/strings.xml:

    <?xml version="1.0" encoding="utf-8"?>
    <resources>
        <string name="game_services_project_id">YOUR_PROJECT_ID</string>
    </resources>
  2. Add meta-data in the application node of AndroidManifest.xml:

    <meta-data
        android:name="com.google.android.gms.games.APP_ID"
        android:value="@string/game_services_project_id"/>
  3. 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'

Dependencies

  • com.gameframex.unity: GameFrameX core framework
  • com.gameframex.unity.getchannel: Channel management

Documentation & Resources

Community & Support

  • QQ Group: 467608841 / 233840761

Changelog

See Releases for changelog.

License

See LICENSE.md for license information.

About

GameFrameX Unity Google Sign-In integration component for authenticating users via Google accounts

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages