AppCheck with Flutter/Firebase - AppCheck failed: 'The operation couldn't be completed.'
Asked Answered
B

0

7

Here's the link of the documentation for the issue I'm facing: https://firebase.google.com/docs/app-check/flutter/debug-provider?hl=en&authuser=0

I'm following the steps to integrate AppCheck to my Flutter/Firebase application. I've already registered DeviceCheck and AppAttest in the Firebase console and now I want to test if everything works correctly during testing/debug. For this, I have to take additional steps which can be found in the link I've shared above.

I've already completed steps 1 & 2 (Apple platforms) and for #3, I'm not very familiar with XCode but this is what I've tried: Using Visual Studio Code, I've right clicked the 'ios' folder and then clicked on 'Open with XCode'. In XCode, I've simply clicked on 'Product' and then 'Run'. I'm not sure if this was the right thing to do. The documentation says to open ios/Runner.xcworkspace and then run your project but I'm not sure if I've done this step correctly because once the app opens in the simulator, I'm receiving this message:

AppCheck failed: 'The operation couldn't be completed. (com.apple.devicecheck.error error 1.)

If everything works correctly, I should instead receive a token like the example below:

[Firebase/AppCheck][I-FAA001001] Firebase App Check Debug Token:
123a4567-b89c-12d3-e456-789012345678

And here's the code in the main.dart file:

import 'package:flutter/material.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:firebase_app_check/firebase_app_check.dart';

Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await Firebase.initializeApp();
  await FirebaseAppCheck.instance.activate(
    androidProvider: AndroidProvider.debug,
  );
  runApp(App());
}
Bowhead answered 9/1, 2023 at 22:40 Comment(4)
Hi @Bowhead have checked this documentation firebase.flutter.dev/docs/app-check/debug-provider ? If not you need some configuration for apple.Windfall
Hello my friend, you can let me know if I'm wrong but I believe that page is an older archived version on how to Use App Check with the debug provider, the one I linked (firebase.google.com/docs/app-check/flutter/debug-provider) is the most recently updated version.Bowhead
check this answer this may help. #70810209Arquit
I've already followed/finished those steps (registered key on apple developer account) and the issue is still there.Bowhead

© 2022 - 2024 — McMap. All rights reserved.