Skip to content

Commit 9e538a7

Browse files
committed
Version 1.0 of plugin.
2 parents f798103 + 2c3f4c5 commit 9e538a7

File tree

72 files changed

+5402
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+5402
-1
lines changed

Diff for: .gitignore

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
.gradle/
2+
.idea/
3+
bin/
4+
build/
5+
*.iml
6+
local.properties
7+
local.settings
8+
.externalNativeBuild/
9+
*.apk
10+
11+
*.sln
12+
*.userprefs
13+
Library/
14+
ProjectSettings/
15+
Temp/
16+
obj/
17+
18+
# Don't check in the resolver
19+
GoogleSignInPlugin/Assets/PlayServicesResolver/
20+
21+
# don't checkin client plists
22+
GoogleSignInPlugin/Assets/Plugins/iOS/client*.plist*
23+
24+
Assembly-CSharp-Editor.csproj
25+
Assembly-CSharp.csproj

Diff for: CONTRIBUTING.md

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
Want to contribute? Great! First, read this page (including the small print at the end).
2+
3+
### Before you contribute
4+
Before we can use your code, you must sign the
5+
[Google Individual Contributor License Agreement](https://developers.google.com/open-source/cla/individual?csw=1)
6+
(CLA), which you can do online. The CLA is necessary mainly because you own the
7+
copyright to your changes, even after your contribution becomes part of our
8+
codebase, so we need your permission to use and distribute your code. We also
9+
need to be sure of various other things — for instance that you'll tell us if you
10+
know that your code infringes on other people's patents. You don't have to sign
11+
the CLA until after you've submitted your code for review and a member has
12+
approved it, but you must do it before we can put your code into our codebase.
13+
Before you start working on a larger contribution, you should get in touch with
14+
us first through the issue tracker with your idea so that we can help out and
15+
possibly guide you. Coordinating up front makes it much easier to avoid
16+
frustration later on.
17+
18+
### Code reviews
19+
All submissions, including submissions by project members, require review. We
20+
use Github pull requests for this purpose.
21+
22+
### The small print
23+
Contributions made by corporations are covered by a different agreement than
24+
the one above, the Software Grant and Corporate Contributor License Agreement.

Diff for: GoogleSignInPlugin/Assets/GoogleSignIn.meta

+9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: GoogleSignInPlugin/Assets/GoogleSignIn/Editor.meta

+9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<?xml version="1.0" encoding="UTF-8" ?>
2+
<dependencies>
3+
<!-- See https://github.com/googlesamples/unity-jar-resolver#usage for
4+
how to configure dependencies -->
5+
<androidPackages>
6+
<!--- Auth THIS IS ALWAYS REQUIRED -->
7+
<!-- The dependency is actually on 10.2, but 10+ is close enough.
8+
If you have problems, please change this to a concrete value.
9+
-->
10+
<androidPackage spec="com.google.android.gms:play-services-auth:10+">
11+
<androidSdkPackageIds>
12+
<androidSdkPackageId>extra-google-m2repository</androidSdkPackageId>
13+
</androidSdkPackageIds>
14+
</androidPackage>
15+
16+
<!-- IF YOU ARE USING THE GAMES_CONFIG TO SIGN-IN, YOU NEED TO
17+
UNCOMMENT THIS DEPENDENCY!!
18+
19+
This is only used if you need to add play-services-games to your
20+
project.
21+
-->
22+
<!--
23+
<androidPackage spec="com.google.android.gms:play-services-games:10+">
24+
<androidSdkPackageIds>
25+
<androidSdkPackageId>extra-google-m2repository</androidSdkPackageId>
26+
</androidSdkPackageIds>
27+
</androidPackage>
28+
-->
29+
30+
</androidPackages>
31+
32+
<!-- iOS Cocoapod dependencies can be specified by each iosPod element. -->
33+
<iosPods>
34+
<iosPod name="GoogleSignIn" version=">= 4.0.2" bitcodeEnabled="false"
35+
minTargetSdk="6.0">
36+
</iosPod>
37+
</iosPods>
38+
</dependencies>

Diff for: GoogleSignInPlugin/Assets/GoogleSignIn/Editor/GoogleSignInDependencies.xml.meta

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: GoogleSignInPlugin/Assets/GoogleSignIn/Future.cs

+84
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
// <copyright file="Future.cs" company="Google Inc.">
2+
// Copyright (C) 2017 Google Inc. All Rights Reserved.
3+
//
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
//
8+
// http://www.apache.org/licenses/LICENSE-2.0
9+
//
10+
// Unless required by applicable law or agreed to in writing, software
11+
// distributed under the License is distributed on an "AS IS" BASIS,
12+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
// See the License for the specific language governing permissions and
14+
// limitations under the License.
15+
// </copyright>
16+
namespace Google {
17+
using System.Collections;
18+
using System.Threading.Tasks;
19+
using UnityEngine;
20+
21+
/// <summary>
22+
/// Interface for implementations of the Future<T> API.
23+
/// </summary>
24+
internal interface FutureAPIImpl<T> {
25+
bool Pending { get; }
26+
GoogleSignInStatusCode Status { get; }
27+
T Result { get; }
28+
}
29+
30+
/// <summary>
31+
/// Future return value.
32+
/// </summary>
33+
/// <remarks>This class provides a promise of a result from a method call.
34+
/// The typical usage is to check the Pending property until it is false.
35+
/// At this time either the Status or Result will be available for use.
36+
/// Result is only set if the operation was successful.
37+
/// As a convience, a coroutine to complete a Task is provided.
38+
/// </remarks>
39+
public class Future<T> {
40+
41+
private FutureAPIImpl<T> apiImpl;
42+
43+
internal Future(FutureAPIImpl<T> impl) {
44+
apiImpl = impl;
45+
}
46+
47+
/// <summary>
48+
/// Gets a value indicating whether this
49+
/// <see cref="T:Google.Future`1"/> is pending.
50+
/// </summary>
51+
/// <value><c>true</c> if pending; otherwise, <c>false</c>.</value>
52+
public bool Pending { get { return apiImpl.Pending; } }
53+
54+
/// <summary>
55+
/// Gets the status.
56+
/// </summary>
57+
/// <value>The status is set when Pending == false.</value>
58+
GoogleSignInStatusCode Status { get { return apiImpl.Status; } }
59+
60+
/// <summary>
61+
/// Gets the result.
62+
/// </summary>
63+
/// <value>The result is set when Pending == false and there is no error.
64+
/// </value>
65+
T Result { get { return apiImpl.Result; } }
66+
67+
/// <summary>
68+
/// Waits for result then completes the TaskCompleationSource.
69+
/// </summary>
70+
/// <returns>The for result.</returns>
71+
/// <param name="tcs">Tcs.</param>
72+
internal IEnumerator WaitForResult(TaskCompletionSource<T> tcs) {
73+
yield return new WaitUntil(() => !Pending);
74+
if (Status == GoogleSignInStatusCode.Canceled) {
75+
tcs.SetCanceled();
76+
} else if (Status == GoogleSignInStatusCode.Success ||
77+
Status == GoogleSignInStatusCode.SuccessCached) {
78+
tcs.SetResult(Result);
79+
} else {
80+
tcs.SetException(new GoogleSignIn.SignInException(Status));
81+
}
82+
}
83+
}
84+
}

Diff for: GoogleSignInPlugin/Assets/GoogleSignIn/Future.cs.meta

+12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)