Firebase/Flutter - App Attest Debug Token not working on Simulator

33 Views Asked by At

I'm having an issue with App Attest and Firebase. I'm having my flutter app and tried to enable App Attest. Therefor I did what the documentation was saying:

  1. Set up firebase project
  2. Add the App check library to the app
  3. Initialize app check.

After that I enforced App Check in Firebase. App Attest and accessing the data does work if I publish to real device.

No I'm having the issue when using an simulator. I know, that I have to do some things to get it working on the simulator: https://firebase.google.com/docs/app-check/flutter/debug-provider:

  1. Activate App Check with debug provider
if (!kDebugMode) {
    await FirebaseAppCheck.instance.activate(
      androidProvider: AndroidProvider.playIntegrity,
      appleProvider: AppleProvider.appAttest,
    );
  } else {
    print("Debug Mode");
    try {
      await FirebaseAppCheck.instance.activate(
          androidProvider: AndroidProvider.debug,
          appleProvider: AppleProvider.debug);
     
    } on FirebaseException catch (e) {

      print("FirebaseException:" + e.toString());
    }
  }
  1. Enable debug logging in Xcode

Enable debug logging in Xcode

  1. Get the local debug token from the debug output.

Get the local debug token

  1. In Firebase add the debug token to the registered debug tokens.

Add debug token to firebase

Unfortunately here starts the problem. After doing all this stuff, I cannot access the firestore data in the app through the simulator (android does work, iOS not). It keeps saying me, that I don't have the permissions: "[cloud_firestore/permission-denied] The caller does not have permission to execute the specified operation."

DB-Rules should not be a problem, as they are not if I use a real device or I disable app Attest.

Additional info:

-) I changed app-attest-environment from "development" to "production"

app-attest-environment

-) Added appAttest capability in Xcode

Any ideas, what the hell is the problem?

0

There are 0 best solutions below