Skip to content

iOS requestScopes in google_sign_in package returns false even with granted permissions for Google Calendar API #157639

@mysCod3r

Description

@mysCod3r

Steps to reproduce

  1. Set up Firebase Authentication and Google Calendar API:

    • Firebase Authentication and Google Sign-In are configured in the Firebase Console.
    • Google Calendar API is enabled in Google Cloud Console.
  2. Create OAuth Credentials:

    • OAuth 2.0 credentials were generated for both Android and iOS within the Google Cloud Console.
    • For iOS, the REVERSED_CLIENT_ID is correctly set up in the app’s Info.plist.
  3. Sign In and Request Scopes:

    • After signing in with Google, calling requestScopes for calendar access prompts a permissions request. Even after granting permission, the method still returns false.

Expected results

  • requestScopes should return true upon successful granting of permissions, as it does on Android.

Actual results

  • requestScopes always returns false on iOS, despite receiving an email from Google indicating that access was granted.

Code sample

Code sample
static const _scopes = [  CalendarApi.calendarReadonlyScope,  CalendarApi.calendarEventsReadonlyScope,];

final isAuthorized = await _googleSignIn.requestScopes(_scopes);
print(isAuthorized); // Returns false even after granting permission

Screenshots or Video

No response

Logs

No response

Flutter Doctor output

Doctor output
[✓] Flutter (Channel stable, 3.24.3, on macOS 15.0.1 24A348 darwin-arm64, locale en-TR)
    • Flutter version 3.24.3 on channel stable at /Users/yasinsenocak/src/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 2663184aa7 (6 weeks ago), 2024-09-11 16:27:48 -0500
    • Engine revision 36335019a8
    • Dart version 3.5.3
    • DevTools version 2.37.3

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/yasinsenocak/Library/Android/sdk
    • Platform android-34, build-tools 34.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.9+0-17.0.9b1087.7-11185874)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 16.0)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 16A242d
    • CocoaPods version 1.15.2

[✗] Chrome - develop for the web (Cannot find Chrome executable at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome)
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.

[✓] Android Studio (version 2023.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.9+0-17.0.9b1087.7-11185874)

[✓] VS Code (version 1.94.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.98.0

[✓] Connected device (5 available)
    • sdk gphone64 arm64 (mobile)      • emulator-5554                        • android-arm64 • Android 15 (API 35) (emulator)
    • Muhammed Yasin’s iPhone (mobile) • 00008030-000C489E3ED3402E            • ios           • iOS 18.0.1 22A3370
    • iPhone 15 Pro (mobile)           • 70CA95D0-3768-4BA0-ABC0-0E081F9D4220 • ios           •
      com.apple.CoreSimulator.SimRuntime.iOS-18-0 (simulator)
    • macOS (desktop)                  • macos                                • darwin-arm64  • macOS 15.0.1 24A348 darwin-arm64
    • Mac Designed for iPad (desktop)  • mac-designed-for-ipad                • darwin        • macOS 15.0.1 24A348 darwin-arm64

[✓] Network resources
    • All expected network resources are available.```

</details>

Metadata

Metadata

Labels

P2Important issues not at the top of the work listfound in release: 3.24Found to occur in 3.24found in release: 3.27Found to occur in 3.27has reproducible stepsThe issue has been confirmed reproducible and is ready to work onp: google_sign_inThe Google Sign-In pluginpackageflutter/packages repository. See also p: labels.platform-iosiOS applications specificallyr: fixedIssue is closed as already fixed in a newer versionteam-iosOwned by iOS platform teamtriaged-iosTriaged by iOS platform team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions