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());
}