An open API service indexing awesome lists of open source software.

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.

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