Skip to content
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

App Check not printing debug token to console for iOS using Flutter #16951

Open
HaydenHMSD opened this issue Jan 8, 2025 · 5 comments
Open
Labels
blocked: customer-response Waiting for customer response, e.g. more information was requested. platform: ios Issues / PRs which are specifically for iOS. plugin: app_check resolution: needs-repro This issue could not be reproduced or needs an up to date reproduction on latest FlutterFire plugin. type: bug Something isn't working

Comments

@HaydenHMSD
Copy link

HaydenHMSD commented Jan 8, 2025

Up until a few months ago my Flutter project was printing to the console all the Firebase logs including the debug token for App Check.

They have stopped being printed now.

Everything shows up and works correctly on Android

in my pubspec I have added

  firebase_app_check: ^0.3.2
  firebase_core: ^3.10.0
  firebase_crashlytics: ^4.3.0
  firebase_performance: ^0.10.1
  firebase_messaging: ^15.2.0
  firebase_remote_config: ^5.3.0

I am running the app on iOS 18, both device and simulator.
I haven't changed the App Check configurations in Firebase since the first time it started working.

This is my current Flutter Doctor:

    • Flutter version 3.24.5 on channel stable at /Users/haydenyoung/DevTools/Flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision dec2ee5c1f (8 weeks ago), 2024-11-13 11:13:06 -0800
    • Engine revision a18df97ca5
    • Dart version 3.5.4
    • DevTools version 2.37.3

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/haydenyoung/Library/Android/sdk
    • Platform android-34, build-tools 34.0.0
    • ANDROID_HOME = /Users/haydenyoung/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 21.0.3+-79915915-b509.11)
    • All Android licenses accepted.

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

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2024.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 21.0.3+-79915915-b509.11)

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

my implementation in code has not changed

await FirebaseAppCheck.instance.activate(
        webProvider: ReCaptchaV3Provider('recaptcha-v3-site-key'),
        androidProvider: AndroidProvider.debug,
        appleProvider: AppleProvider.debug,
      );
final token = await appCheck.getToken();
      dev.log('token: $token');
@SelaseKay SelaseKay added type: bug Something isn't working platform: ios Issues / PRs which are specifically for iOS. Needs Attention This issue needs maintainer attention. plugin: app_check labels Jan 8, 2025
@SelaseKay
Copy link
Contributor

Hi @HaydenHMSD, I couldn't reproduce this issue using the current firebase_app_check example app. It successfully prints the debug token on my end. Are there any errors related to app_check in your logs?

@SelaseKay SelaseKay added blocked: customer-response Waiting for customer response, e.g. more information was requested. and removed Needs Attention This issue needs maintainer attention. labels Jan 8, 2025
@HaydenHMSD
Copy link
Author

@SelaseKay thanks for the reply!

I don't get any error logs printed apart from the usual:

- URL: https://firebaseappcheck.googleapis.com/v1/projects/{project-name}/apps/1{app-id}:exchangeDebugToken 
 - HTTP status code: 403 
 - Response body: {
  "error": {
    "code": 403,
    "message": "App attestation failed.",
    "status": "PERMISSION_DENIED"
  }
}

which is expected when I haven't added the debug token to app_check.

I've not seen any logs on Firebase.

This started happening probably around sometime after updating Android Studio to Ladybug, or with the release of iOS 18 if that helps with anything.
That said, I did try build the app with the previous version of Android Studio and for iOS 17 and I still don't get the logs.

@google-oss-bot google-oss-bot added Needs Attention This issue needs maintainer attention. and removed blocked: customer-response Waiting for customer response, e.g. more information was requested. labels Jan 9, 2025
@SelaseKay
Copy link
Contributor

Thanks for the additional feedback. A clear way to reproduce this will be much appreciated as I haven't been able to reproduce this issue on my end.

@SelaseKay SelaseKay added blocked: customer-response Waiting for customer response, e.g. more information was requested. and removed Needs Attention This issue needs maintainer attention. labels Jan 9, 2025
@HaydenHMSD
Copy link
Author

I wish I could tell you more, but I'm not sure what else to look at.

I don't know if some configuration changed without me knowing

I've tried building from Android Studio, VS Code and Xcode as well as looking at the console on DevTools. I've tried building to device and simulator too. None of the firebase logs show up.

I've also added the -FIRDebugEnabled flag into the "Arguments passed on launch" for the schemes in Xcode but that didn't do anything.

Is there anything else that I could share that isn't the project itself?

@google-oss-bot google-oss-bot added Needs Attention This issue needs maintainer attention. and removed blocked: customer-response Waiting for customer response, e.g. more information was requested. labels Jan 9, 2025
@SelaseKay SelaseKay added resolution: needs-repro This issue could not be reproduced or needs an up to date reproduction on latest FlutterFire plugin. and removed Needs Attention This issue needs maintainer attention. labels Jan 10, 2025
@SelaseKay
Copy link
Contributor

Are you able to reproduce this is in a new flutter project?

@SelaseKay SelaseKay added the blocked: customer-response Waiting for customer response, e.g. more information was requested. label Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked: customer-response Waiting for customer response, e.g. more information was requested. platform: ios Issues / PRs which are specifically for iOS. plugin: app_check resolution: needs-repro This issue could not be reproduced or needs an up to date reproduction on latest FlutterFire plugin. type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants