Skip to content

Request youtube data api permission instead of "games" scope #725

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 24, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions app/src/main/java/com/firebase/uidemo/auth/AuthUiActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ public class AuthUiActivity extends AppCompatActivity {
@BindView(R.id.google_scope_drive_file)
CheckBox mGoogleScopeDriveFile;

@BindView(R.id.google_scope_games)
CheckBox mGoogleScopeGames;
@BindView(R.id.google_scope_youtube_data)
CheckBox mGoogleScopeYoutubeData;

@Override
public void onCreate(Bundle savedInstanceState) {
Expand Down Expand Up @@ -250,7 +250,7 @@ private void startSignedInActivity(IdpResponse response) {
private void setGoogleScopesEnabled(boolean enabled) {
mGoogleScopesLabel.setEnabled(enabled);
mGoogleScopeDriveFile.setEnabled(enabled);
mGoogleScopeGames.setEnabled(enabled);
mGoogleScopeYoutubeData.setEnabled(enabled);
}

@MainThread
Expand Down Expand Up @@ -369,8 +369,8 @@ private List<String> getFacebookPermissions() {
@MainThread
private List<String> getGooglePermissions() {
List<String> result = new ArrayList<>();
if (mGoogleScopeGames.isChecked()) {
result.add(Scopes.GAMES);
if (mGoogleScopeYoutubeData.isChecked()) {
result.add("https://www.googleapis.com/auth/youtube.readonly");
}
if (mGoogleScopeDriveFile.isChecked()) {
result.add(Scopes.DRIVE_FILE);
Expand Down
8 changes: 4 additions & 4 deletions app/src/main/res/layout/auth_ui_layout.xml
Original file line number Diff line number Diff line change
Expand Up @@ -207,18 +207,18 @@
android:text="@string/extra_google_scopes"/>

<CheckBox
android:id="@+id/google_scope_games"
android:id="@+id/google_scope_drive_file"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="false"
android:text="@string/games"/>
android:text="@string/drive_file_scope"/>

<CheckBox
android:id="@+id/google_scope_drive_file"
android:id="@+id/google_scope_youtube_data"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="false"
android:text="@string/drive_file"/>
android:text="@string/youtube_data_scope"/>

<TextView
style="@style/Base.TextAppearance.AppCompat.Subhead"
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@
<string name="rational_image_perm">This sample will read an image from local storage to upload to Cloud Storage.</string>
<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>
<string name="extra_google_scopes">Example extra Google scopes</string>
<string name="games">Games</string>
<string name="drive_file_scope">Drive File</string>
<string name="youtube_data_scope">Youtube data</string>
<string name="extra_facebook_scopes">Example extra Facebook scopes</string>
<string name="friends">Friends</string>
<string name="photos">Photos</string>
Expand All @@ -62,7 +63,6 @@
<string name="upload">Upload</string>
<string name="choose_image">Choose Image</string>
<string name="accessibility_downloaded_image">Downloaded image</string>
<string name="drive_file">Drive File</string>
<string name="allow_new_email_acccount">Allow account creation if email does not exist.</string>
<string name="reauthenticate">Reauth</string>
<string name="reauthentication_reason">Reauth was requested from the test app. Please login to continue.</string>
Expand Down