Skip to content

Commit 251d757

Browse files
authored
Merge pull request #725 from SUPERCILEX/example-scope
Request youtube data api permission instead of "games" scope
2 parents a6f8309 + b882219 commit 251d757

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

app/src/main/java/com/firebase/uidemo/auth/AuthUiActivity.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,8 @@ public class AuthUiActivity extends AppCompatActivity {
120120
@BindView(R.id.google_scope_drive_file)
121121
CheckBox mGoogleScopeDriveFile;
122122

123-
@BindView(R.id.google_scope_games)
124-
CheckBox mGoogleScopeGames;
123+
@BindView(R.id.google_scope_youtube_data)
124+
CheckBox mGoogleScopeYoutubeData;
125125

126126
@Override
127127
public void onCreate(Bundle savedInstanceState) {
@@ -250,7 +250,7 @@ private void startSignedInActivity(IdpResponse response) {
250250
private void setGoogleScopesEnabled(boolean enabled) {
251251
mGoogleScopesLabel.setEnabled(enabled);
252252
mGoogleScopeDriveFile.setEnabled(enabled);
253-
mGoogleScopeGames.setEnabled(enabled);
253+
mGoogleScopeYoutubeData.setEnabled(enabled);
254254
}
255255

256256
@MainThread
@@ -369,8 +369,8 @@ private List<String> getFacebookPermissions() {
369369
@MainThread
370370
private List<String> getGooglePermissions() {
371371
List<String> result = new ArrayList<>();
372-
if (mGoogleScopeGames.isChecked()) {
373-
result.add(Scopes.GAMES);
372+
if (mGoogleScopeYoutubeData.isChecked()) {
373+
result.add("https://www.googleapis.com/auth/youtube.readonly");
374374
}
375375
if (mGoogleScopeDriveFile.isChecked()) {
376376
result.add(Scopes.DRIVE_FILE);

app/src/main/res/layout/auth_ui_layout.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -207,18 +207,18 @@
207207
android:text="@string/extra_google_scopes"/>
208208

209209
<CheckBox
210-
android:id="@+id/google_scope_games"
210+
android:id="@+id/google_scope_drive_file"
211211
android:layout_width="wrap_content"
212212
android:layout_height="wrap_content"
213213
android:checked="false"
214-
android:text="@string/games"/>
214+
android:text="@string/drive_file_scope"/>
215215

216216
<CheckBox
217-
android:id="@+id/google_scope_drive_file"
217+
android:id="@+id/google_scope_youtube_data"
218218
android:layout_width="wrap_content"
219219
android:layout_height="wrap_content"
220220
android:checked="false"
221-
android:text="@string/drive_file"/>
221+
android:text="@string/youtube_data_scope"/>
222222

223223
<TextView
224224
style="@style/Base.TextAppearance.AppCompat.Subhead"

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@
5050
<string name="rational_image_perm">This sample will read an image from local storage to upload to Cloud Storage.</string>
5151
<string name="anonymous_auth_failed_msg">Anonymous authentication failed, various components of the demo will not work. Make sure your device is online and that Anonymous Auth is configured in your Firebase project(https://console.firebase.google.com/project/_/authentication/providers)</string>
5252
<string name="extra_google_scopes">Example extra Google scopes</string>
53-
<string name="games">Games</string>
53+
<string name="drive_file_scope">Drive File</string>
54+
<string name="youtube_data_scope">Youtube data</string>
5455
<string name="extra_facebook_scopes">Example extra Facebook scopes</string>
5556
<string name="friends">Friends</string>
5657
<string name="photos">Photos</string>
@@ -62,7 +63,6 @@
6263
<string name="upload">Upload</string>
6364
<string name="choose_image">Choose Image</string>
6465
<string name="accessibility_downloaded_image">Downloaded image</string>
65-
<string name="drive_file">Drive File</string>
6666
<string name="allow_new_email_acccount">Allow account creation if email does not exist.</string>
6767
<string name="reauthenticate">Reauth</string>
6868
<string name="reauthentication_reason">Reauth was requested from the test app. Please login to continue.</string>

0 commit comments

Comments
 (0)