0

I've registered the Android and iOS versions of my Flutter app for AppCheck but it doesn't seem to work. I chose App Attest instead of DeviceCheck for iOS since it was more simple and AppCheck is initialized in the main function when the app starts. I followed all the steps in the docs but it's not working. Now that I'm trying to use Firestore I'm getting these errors:

2022-08-21 21:05:15.939832+0300 Runner[62843:4842857] 9.2.0 - [FirebaseFirestore][I-FST000001] AppCheck failed: 'The operation couldn’t be completed. Too many attempts. Underlying error: The operation couldn’t be completed. The server responded with an error: 
 - URL: https://firebaseappcheck.googleapis.com/v1/projects/globe-rebrand/apps/1:521611501234:ios:b441db59d1e4181485f3ab:exchangeDeviceCheckToken 
 - HTTP status code: 400 
 - Response body: {
  "error": {
    "code": 400,
    "message": "App not registered: 1:521611501234:ios:b441db59d1e4181485f3ab.",
    "status": "FAILED_PRECONDITION"
  }
}
'
2022-08-21 21:05:16.504869+0300 Runner[62843:4843044] 9.2.0 - [FirebaseFirestore][I-FST000001] WriteStream (155018878) Stream error: 'Permission denied: Missing or insufficient permissions.'
2022-08-21 21:05:16.505803+0300 Runner[62843:4843044] 9.2.0 - [FirebaseFirestore][I-FST000001] Write at users/ET41oMbo0bVcAAx0hv3QacIYfqC2 failed: Missing or insufficient permissions.
Globe
  • 514
  • 3
  • 17

1 Answers1

0

Few points you could check

  1. Download Google services info. Plist from firebase

  2. Add it though xcode (very important) please don't add it directly to the ios folder

  3. Add the reverse client id in info.plist

  4. Make sure you call firebase. Initialise before you make any other call

  5. If you downloaded the app from test flight to check please delete it and install the app from xcode once.

Kaushik Chandru
  • 15,510
  • 2
  • 12
  • 30
  • I’m experienced with Firebase in general so I know everything is initialized and set up properly. The part that is new to me is AppCheck, this is my first time trying to use it. The app is still in development so it’s installed directly to my device from Xcode, not from Test Flight. I think the errors show that AppCheck is failing. – Globe Aug 21 '22 at 20:27