Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Updating for 1.0.4
* bumped tooling versions to latest
* handled cancelled and other onActivityResult() return codes that
  cause NPE.
* Depend on latest Play Services Auth library.

Change-Id: Ib783e6943800d86d5a13aafd6dc86bdea601b0ab
  • Loading branch information
claywilkinson committed Sep 19, 2018
1 parent 9faa90f commit 588c063
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 11 deletions.
Expand Up @@ -3,7 +3,7 @@
<!-- See https://github.com/googlesamples/unity-jar-resolver#usage for
how to configure dependencies -->
<androidPackages>
<androidPackage spec="com.google.android.gms:play-services-auth:10+">
<androidPackage spec="com.google.android.gms:play-services-auth:16+">
<androidSdkPackageIds>
<androidSdkPackageId>extra-google-m2repository</androidSdkPackageId>
</androidSdkPackageIds>
Expand Down
6 changes: 4 additions & 2 deletions build.gradle
Expand Up @@ -19,10 +19,11 @@ import groovy.io.FileType

buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.android.tools.build:gradle:3.1.4'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand All @@ -31,6 +32,7 @@ buildscript {

allprojects {
repositories {
google()
jcenter()
}
}
Expand Down Expand Up @@ -66,7 +68,7 @@ project.ext {
git_exe = 'git'
}

pluginVersion = "1.0.3"
pluginVersion = "1.0.4"
currentPluginBasename = 'google-signin-plugin'
currentPluginName = (currentPluginBasename + '-' + pluginVersion +
'.unitypackage')
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
5 changes: 2 additions & 3 deletions native-googlesignin/build.gradle
Expand Up @@ -33,7 +33,6 @@ project.ext.baseName = "google-signin-support"

android {
compileSdkVersion 26
buildToolsVersion "26.0.3"
defaultConfig {
minSdkVersion 14
targetSdkVersion 26
Expand All @@ -45,7 +44,7 @@ android {
}
}
ndk {
abiFilters 'x86', 'armeabi-v7a'
abiFilters 'x86', 'armeabi-v7a', 'arm64-v8a'
}
}
lintOptions {
Expand Down Expand Up @@ -113,5 +112,5 @@ uploadArchives {
}

dependencies {
compile "com.google.android.gms:play-services-auth:10.2.6"
api "com.google.android.gms:play-services-auth:16.0.0"
}
Expand Up @@ -412,7 +412,7 @@ private void buildClient(TokenRequest request) {
}
}
if (request.getHidePopups()) {
View invisible = new View(getContext());
View invisible = new View(getActivity());
invisible.setVisibility(View.INVISIBLE);
invisible.setClickable(false);
clientBuilder.setViewForPopups(invisible);
Expand Down Expand Up @@ -456,7 +456,7 @@ private GoogleSignInOptionsExtension getGamesExtension() {
setter.invoke(builder, false);

Method buildMethod = builder.getClass().getMethod("build");
return (GoogleSignInOptionsExtension) builderMethod.invoke(builder);
return (GoogleSignInOptionsExtension) buildMethod.invoke(builder);

} catch (ClassNotFoundException e) {
throw new IllegalArgumentException(
Expand Down Expand Up @@ -526,8 +526,15 @@ public void onActivityResult(int requestCode, int resultCode, Intent data) {
GoogleSignInResult result = Auth.GoogleSignInApi.getSignInResultFromIntent(data);
TokenRequest request = this.request;
if (request != null) {
GoogleSignInAccount acct = result.getSignInAccount();
request.setResult(result.getStatus().getStatusCode(), acct);
if (result == null) {
// This usually indicates a problem with Google Play Services not working correctly.
int returnCode = resultCode >= 0 ? CommonStatusCodes.ERROR : resultCode;
request.setResult( returnCode, null);
GoogleSignInHelper.logError("GoogleSignIn result is null, returning error.");
} else {
GoogleSignInAccount acct = result.getSignInAccount();
request.setResult(result.getStatus().getStatusCode(), acct);
}
} else {
GoogleSignInHelper.logError("Pending request is null, can't " + "return result!");
}
Expand Down

0 comments on commit 588c063

Please sign in to comment.