Skip to content

Commit 3f12e19

Browse files
committed
Implemented hacky Google sign-in
1 parent 59236f1 commit 3f12e19

16 files changed

+230
-228
lines changed

app/build.gradle

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ android {
77

88
defaultConfig {
99
applicationId "com.firebase.uidemo"
10-
minSdkVersion 15
10+
minSdkVersion 16
1111
targetSdkVersion 22
1212
versionCode 1
1313
versionName "1.0"
@@ -29,8 +29,7 @@ android {
2929
dependencies {
3030
compile fileTree(dir: 'libs', include: ['*.jar'])
3131
compile 'com.android.support:appcompat-v7:22.2.0'
32-
compile 'com.google.android.gms:play-services-identity:8.1.0'
33-
compile 'com.google.android.gms:play-services-plus:8.1.0'
32+
compile 'com.google.android.gms:play-services-auth:8.3.0'
3433
compile 'com.firebase:firebase-client-android:2.3.1'
3534
compile 'com.android.support:recyclerview-v7:22.2.1'
3635
compile 'com.facebook.android:facebook-android-sdk:4.6.0'

app/google-services.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"project_info":{"project_id":"firebaseui","project_number":"945226082630","name":"FirebaseUI"},"client":[{"client_info":{"mobilesdk_app_id":"1:945226082630:android:91eecf4730fc920b","client_id":"android:com.firebase.uidemo","client_type":1,"android_client_info":{"package_name":"com.firebase.uidemo"}},"oauth_client":[{"client_id":"945226082630-89h2p3g5jr54gq1kccr15ig5qj9l1i0c.apps.googleusercontent.com","client_type":1,"android_info":{"package_name":"com.firebase.uidemo","certificate_hash":"29E1FFD35E7D0EDD6F4FD574CE1516B1051B6472"}}],"api_key":[{"current_key":"AIzaSyAx2pLbFgIcFNQOvYRkUv83rv-nKX-76vc"}],"services":{"analytics_service":{"status":1},"cloud_messaging_service":{"status":2,"apns_config":[]},"appinvite_service":{"status":1,"other_platform_oauth_client":[]},"google_signin_service":{"status":2},"ads_service":{"status":1}}}],"client_info":[],"ARTIFACT_VERSION":"1"}

app/src/main/AndroidManifest.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@
4040
android:name="com.facebook.sdk.ApplicationId"
4141
android:value="@string/facebook_app_id" />
4242

43+
<activity android:name="com.firebase.ui.auth.google.GoogleSignInActivity" />
44+
4345

4446
</application>
4547

app/src/main/java/com/firebase/uidemo/RecyclerViewDemoActivity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public void onComplete(FirebaseError firebaseError, Firebase firebase) {
6868
mMessages = (RecyclerView) findViewById(R.id.messagesList);
6969

7070
LinearLayoutManager manager = new LinearLayoutManager(this);
71-
manager.setStackFromEnd(true);
71+
manager.setReverseLayout(false);
7272

7373
mMessages.setHasFixedSize(false);
7474
mMessages.setLayoutManager(manager);

build.gradle

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ buildscript {
66
}
77
dependencies {
88
classpath 'com.android.tools.build:gradle:1.2.3'
9-
classpath 'com.google.gms:google-services:1.4.0-beta3'
9+
classpath 'com.google.gms:google-services:1.5.0-beta2'
1010
// NOTE: Do not place your application dependencies here; they belong
1111
// in the individual module build.gradle files
1212
}
@@ -16,6 +16,5 @@ allprojects {
1616
repositories {
1717
jcenter()
1818
mavenCentral()
19-
maven { url 'https://maven.fabric.io/public' }
2019
}
2120
}

library/build.gradle

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ android {
66
buildToolsVersion "22.0.1"
77

88
defaultConfig {
9-
minSdkVersion 15
9+
minSdkVersion 16
1010
targetSdkVersion 22
1111
versionCode 1
1212
versionName "0.2.0"
@@ -45,12 +45,8 @@ dependencies {
4545
compile 'com.android.support:appcompat-v7:22.2.0'
4646
compile 'com.firebase:firebase-client-android:2.3.1'
4747
compile 'com.android.support:recyclerview-v7:22.2.0'
48-
compile 'com.google.android.gms:play-services-identity:8.1.0'
49-
compile 'com.google.android.gms:play-services-plus:8.1.0'
48+
compile 'com.google.android.gms:play-services-auth:8.3.0'
5049
compile 'com.facebook.android:facebook-android-sdk:4.6.0'
5150
compile 'org.twitter4j:twitter4j-core:4.0.2'
52-
compile('com.twitter.sdk.android:twitter:1.9.1@aar') {
53-
transitive = true;
54-
}
5551
androidTestCompile 'junit:junit:4.12'
5652
}

library/google-services.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"project_info":{"project_id":"firebaseui","project_number":"945226082630","name":"FirebaseUI"},"client":[{"client_info":{"mobilesdk_app_id":"1:945226082630:android:91eecf4730fc920b","client_id":"android:com.firebase.uidemo","client_type":1,"android_client_info":{"package_name":"com.firebase.uidemo"}},"oauth_client":[{"client_id":"945226082630-89h2p3g5jr54gq1kccr15ig5qj9l1i0c.apps.googleusercontent.com","client_type":1,"android_info":{"package_name":"com.firebase.uidemo","certificate_hash":"29E1FFD35E7D0EDD6F4FD574CE1516B1051B6472"}}],"api_key":[{"current_key":"AIzaSyAx2pLbFgIcFNQOvYRkUv83rv-nKX-76vc"}],"services":{"analytics_service":{"status":1},"cloud_messaging_service":{"status":2,"apns_config":[]},"appinvite_service":{"status":1,"other_platform_oauth_client":[]},"google_signin_service":{"status":2},"ads_service":{"status":1}}}],"client_info":[],"ARTIFACT_VERSION":"1"}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package com.firebase.ui.auth.core;
2+
3+
/**
4+
* Created by abehaskins on 11/9/15.
5+
*/
6+
public class FirebaseActions {
7+
public static final int LOGIN = 0;
8+
public static final int USER_ERROR = 1;
9+
public static final int PROVIDER_ERROR = 2;
10+
public static final int SUCCESS = 3;
11+
}
12+
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package com.firebase.ui.auth.core;
2+
3+
public class FirebaseErrors {
4+
public static int WRONG_CREDENTIALS = 0;
5+
public static int PROVIDER_NOT_ENABLED = 1;
6+
public static int LOGIN_CANCELLED = 2;
7+
public static int MISC_PROVIDER_ERROR = 3;
8+
public static int INVALID_PROVIDER_APP_ID = 4;
9+
public static int INVALID_PROVIDER_APP_KEY = 5;
10+
public static int MISSING_PROVIDER_APP_ID = 6;
11+
public static int MISSING_PROVIDER_APP_KEY = 7;
12+
}

library/src/main/java/com/firebase/ui/auth/core/FirebaseLoginBaseActivity.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ public void onActivityResult(int requestCode, int resultCode, Intent data) {
8686
} else {
8787
mFacebookAuthHelper.mCallbackManager.onActivityResult(requestCode, resultCode, data);
8888
mTwitterAuthHelper.onActivityResult(requestCode, resultCode, data);
89+
mGoogleAuthHelper.onActivityResult(requestCode, resultCode, data);
8990
}
9091
}
9192

0 commit comments

Comments
 (0)