https://github.com/hiyorin/googlesigninplugin-for-unity
A set of tools for Unity to allow handling Google Sign-in for Android and iOS.
https://github.com/hiyorin/googlesigninplugin-for-unity
android google-sign-in google-signin ios unity
Last synced: 10 months ago
JSON representation
A set of tools for Unity to allow handling Google Sign-in for Android and iOS.
- Host: GitHub
- URL: https://github.com/hiyorin/googlesigninplugin-for-unity
- Owner: hiyorin
- License: mit
- Created: 2018-03-13T10:08:43.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-03-24T08:54:18.000Z (over 8 years ago)
- Last Synced: 2025-07-25T06:29:23.790Z (11 months ago)
- Topics: android, google-sign-in, google-signin, ios, unity
- Language: C#
- Homepage:
- Size: 28.7 MB
- Stars: 10
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# GoogleSigninPlugin
A set of tools for Unity to allow handling Google Sign-in for Android and iOS.
# Install
GoogleSigninPlugin.unitypackage
# Settings
#### Create settings file
* Menu/Settings/Google
#### Android
* Setting ClientId and ClientSecret to GoogleSettings.asset
#### iOS
* Setting ClientId and UrlScheme to GoogleSettings.asset
#### Editor
* Setting ClientId and ClientSecret to GoogleSettings.asset
# Usage
```cs
using GoogleSignIn;
```
#### Example: Sign-in
Call the "SignIn" method and check the items you want to get.
```cs
public IEnumerator Example()
{
yield return GoogleSigninPlugin.Instance.SignIn(
requestEmail:true,
requestId:true,
requestIdToken:true,
requestServerAuthCode:true,
requestProfile:true);
Debug.Log(GoogleSigninPlugin.Instance.Email);
Debug.Log(GoogleSigninPlugin.Instance.Id);
Debug.Log(GoogleSigninPlugin.Instance.IdToken);
Debug.Log(GoogleSigninPlugin.Instance.ServerAuthCode);
Debug.Log(GoogleSigninPlugin.Instance.DisplayName);
}
```
#### Example: Sign-out
```cs
public void Example()
{
GoogleSigninPlugin.Instance.SignOut();
}
```
# AndroidManifest.xml
Replace main Activity.
```xml