Skip to content

Commit 51cd951

Browse files
committed
Update SDK, allow Facebook to use Chrome Custom Tabs
Change-Id: If37b630e311a5b6fcb329cfa8daf57a65dea29e8
1 parent 1c7f348 commit 51cd951

File tree

4 files changed

+36
-6
lines changed

4 files changed

+36
-6
lines changed

app/src/main/res/values/config.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,9 @@
55
and provide your value here.
66
-->
77
<string name="facebook_application_id" translatable="false">CHANGE-ME</string>
8+
9+
<!--
10+
Facebook Application ID, prefixed by 'fb'. Enables Chrome Custom tabs.
11+
-->
12+
<string name="facebook_login_protocol_scheme" translatable="false">fbYOUR_APP_ID</string>
813
</resources>

auth/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ dependencies {
2424
testCompile 'org.mockito:mockito-core:1.10.19'
2525
testCompile "org.robolectric:robolectric:3.1-rc1"
2626
compile "com.android.support:appcompat-v7:${project.ext.support_library_version}"
27-
compile 'com.facebook.android:facebook-android-sdk:4.11.0'
27+
compile 'com.facebook.android:facebook-android-sdk:4.14.1'
2828
compile "com.android.support:design:${project.ext.support_library_version}"
2929

3030
compile "com.google.firebase:firebase-auth:${project.ext.firebase_version}"

auth/src/main/AndroidManifest.xml

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2+
xmlns:tools="http://schemas.android.com/tools"
23
package="com.firebase.ui.auth">
34

45
<application>
@@ -32,10 +33,24 @@
3233
<activity android:theme="@style/FirebaseUI.Translucent"
3334
android:name=".ui.ChooseAccountActivity" >
3435
</activity>
35-
<activity android:theme="@style/FirebaseUI.Translucent"
36-
android:name="com.facebook.FacebookActivity"
37-
android:configChanges=
38-
"keyboard|keyboardHidden|screenLayout|screenSize|orientation"
39-
android:label="@string/app_name" />
36+
37+
<activity
38+
android:name="com.facebook.FacebookActivity"
39+
android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
40+
android:label="@string/app_name"
41+
android:theme="@style/FirebaseUI.Translucent"
42+
tools:replace="android:theme" />
43+
44+
<activity
45+
android:name="com.facebook.CustomTabActivity"
46+
android:exported="true">
47+
<intent-filter>
48+
<action android:name="android.intent.action.VIEW" />
49+
<category android:name="android.intent.category.DEFAULT" />
50+
<category android:name="android.intent.category.BROWSABLE" />
51+
<data android:scheme="@string/facebook_login_protocol_scheme" />
52+
</intent-filter>
53+
</activity>
54+
4055
</application>
4156
</manifest>

auth/src/main/res/values/config.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,16 @@
99
-->
1010
<string name="facebook_application_id" translatable="false">CHANGE-ME</string>
1111

12+
<!--
13+
To enable Chrome Custom Tabs for Facebook Login on devices without the Facebook app
14+
installed, change this value to your Facebook App ID prefixed with 'fb'. This should be
15+
'fb' + the value of the facebook_application_id string above
16+
17+
See:
18+
https://developers.facebook.com/docs/facebook-login/android#chrome_custom_tabs
19+
-->
20+
<string name="facebook_login_protocol_scheme" translatable="false">fbYOUR_APP_ID</string>
21+
1222

1323
<!--
1424
The facebook permissions that this Android Application will request from the

0 commit comments

Comments
 (0)