Google Sign-In

The Google Sign-In feature is a way to interact with the users general Google account.

The main purpose of accessing a users account is to gain permissions to use Google services on their behalf. For Google Play Games features, an example would be to use their Google Drive for the Saved Games feature in order to store saved game data.

If you do not require any permissions or authentication tokens, this part of the plugin does not neccesarily need to be used.

This part of the plugin allows you to manage, request and revoke permissions your application has requested of the user. In addition to this, you can manage signing in for known users, new users and signing them out.

Server Side API Access

In order to gain a server side api access token, you need to have set up your OAuth 2.0 web application client ID. This client ID will be different from your app's client ID.

You can find or create your client ID for your server in the Google API Console.

In the Google API Console, ensure you have selected your project. Then under the Credentials tab on the left, click on CREATE CREDENTIALS and finally select OAuth Client ID.

Image 1

You should be taken to a page titled Create OAuth client ID. Under the Application type dropdown, you must select Web application. Fill in the rest and scroll down and click CREATE.

Image 1

Once created, you should get a pop-up which contains information about your OAuth client. Here you will find your Client ID which you will need. Copy this Client ID for later.

Image 1

If you did not get the pop-up, select Credentials on the left side menu. Then under OAuth 2.0 Client IDs, select your newly created Web Application Client ID's name.

Image 1

This page gives you the same information the pop-up would have given you. Here you can scroll around to find the Additional information section. This is where you will find your Client ID.

Image 1

In Unrael Engine, go to Project Settings -> Plugins on the left menu and Google Play Base V2. Input your Client ID in Google Cloud OAuth Web Client ID.

Image 1

On your applications backend server you can exchange the auth code for access and refresh tokens. This will enable you to call Google APIs on behalf of the user from your backend server.

This plugin does not support your backend server code, it only caters for client side functionality. For more information on setting up your backend, you can read Googles Documentation.

Available Blueprint Nodes

We have designed the blueprints to be as simple as possible, seperating out the different ways to manage a users sign-in and permissions.

Launch Google Sign In

This blueprint starts the Google Sign in Flow, which, if the user is not signed in, will bring up Google's user interface asking the user to sign in.

1

Request Email

Requests the email of the user.

2

Request Id Token

Requests an identification token to send to your web server to identify the user.

3

Request Server Auth Code

Requests a one-time server authentication code to send to your web server.

4

On Success

A delegate producing the Google Sign In Account for the user on a successful login

You can simply click and drag off this pin to create a custom event.

5

On Failure

A delegate producing a Google Sign In Status Code along with a message describing the failure.

You can simply click and drag off this pin to create a custom event.

Google Silent Sign In

This blueprint node attempts to sign the user in without displaying a user interface. This can also be used to retrieve the Google Sign In Account silently.

If access has been revoked, it will fail and you will need to use the "Launch Google Sign In" blueprint node.

1

Request Email

Requests the email of the user.

2

Request Id Token

Requests an identification token to send to your web server to identify the user.

3

Request Server Auth Code

Requests a one-time server authentication code to send to your web server.

4

On Success

A delegate producing the Google Sign In Account for the user on a successful login

You can simply click and drag off this pin to create a custom event.

5

On Failure

A delegate producing a Google Sign In Status Code along with a message describing the failure.

You can simply click and drag off this pin to create a custom event.

Google Is Signed In

A blueprint node indicating if the user is currently signed in to Google or not.

1

Return Value

A boolean indicating if the user is currently signed in with a Google account or not.

Google Sign Out

This blueprint node signs out the current signed-in user if any.

It also clears the account previously selected by the user and a future sign in attempt will require the user pick an account again.

1

On Success

A delegate producing no parameters once sign out is successful.

You can simply click and drag off this pin to create a custom event.

2

On Failure

A delegate producing a Google Sign In Status Code along with a message describing the failure.

You can simply click and drag off this pin to create a custom event.

Google Request Permission

This blueprint allows you to request certain permissions allowing you to access specific Google features on their behalf.

A list of pre-defined permissions/scopes can be found here.

1

Permission Scopes

A list of permissions to be requested.

2

On Success

A delegate producing no parameters once permissions have successfuly been granted.

You can simply click and drag off this pin to create a custom event.

3

On Failure

A delegate producing a Google Sign In Status Code along with a message describing the failure.

You can simply click and drag off this pin to create a custom event.

Google Request Permission Advanced

This blueprint allows you to request any permissions allowing you to access specific Google features on their behalf. You can get a full list of permissions/scopes to use here.

This does not delete the banner ad from memory, you can simply redisplay it after hiding it.
Note: You do not have to reload the banner ad after hiding it.

1

Permission Scopes

A list of permissions to be requested.

2

On Success

A delegate producing no parameters once permissions have successfuly been granted.

You can simply click and drag off this pin to create a custom event.

3

On Failure

A delegate producing a Google Sign In Status Code along with a message describing the failure.

You can simply click and drag off this pin to create a custom event.

Google Has Permission

This blueprint node checks to see if the currently signed in user as granted you permission to access a specific scope from the provided list of Permissions.

1

Google Permission Scope

The predefined scope to check if permission has been granted.

Google Has Permission Advanced

This blueprint node checks to see if the currently signed in user as granted you permission to access any scope.

1

Google Permission Scope

The scope to check if permission has been granted.

Google Revoke Access

This blueprint node revokes access given to the current application. Future sign-in attempts will require the user to re-consent to all requested scopes.

Applications are required to provide users that are signed in with Google the ability to disconnect their Google account from the app. If the user deletes their account, you must delete the information that your app obtained from the Google APIs.

1

On Success

A delegate producing no parameters when access has successfuly been revoked.

You can simply click and drag off this pin to create a custom event.

2

On Failure

A delegate producing a Google Sign In Status Code along with a message describing the failure.

You can simply click and drag off this pin to create a custom event.