AppCheck failed: The attestation provider AppAttestProvider is not supported on current platform and OS version
Asked Answered
S

2

6

I am getting the following error when trying to integrate App Check into my iOS app.

AppCheck failed: 'The operation couldn’t be completed. The attestation provider AppAttestProvider is not supported on current platform and OS version.'

And ever since getting this error, when I try to fetch a document from Firestore, I get Missing or insufficient permissions. even though all my ready/write security rules are set to true.

For reference, I'm using Xcode 13, my projects settings is set to iOS 15.4, and I'm using the App Attest provider. I am pretty confident I implemented everything correctly, including:

  1. Installing FirebaseAppCheck (I used SPM).
  2. Adding App Attest capability to my app.
  3. In my project's .entitlements file, set the App Attest environment to production.
  4. Setting my app check provider factory in my app delegate before calling FirebaseApp.configure().
  5. Enabling App Check in my Firebase console.
Stannite answered 18/7, 2022 at 19:16 Comment(3)
What version of Firebase?Deputation
@PaulBeusterien Oh sorry, 9.0.0 I believe. I have it set to Next Major Version.Stannite
This question is similar to: AppCheck fails on ios Simulator. If you believe it’s different, please edit the question, make it clear how it’s different and/or how the answers on that question are not helpful for your problem.Lightly
S
5

Turns out it was simply because App Check does not work on the simulator without doing a few extra steps. Read this SO post for the solution.

Stannite answered 31/7, 2022 at 3:0 Comment(0)
H
0

in my case, when I opened a new project and app check was running, I was getting this error in my own project. I compared the ios folders and saw that the AppDelegate.swift file was different.

This solution worked for me

Change the AppDelegate.swift file from this

import UIKit
import Flutter
import Firebase

@main
@objc class AppDelegate: FlutterAppDelegate {
  override func application(
    _ application: UIApplication,
    didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
  ) -> Bool {
      FirebaseApp.configure()
      GeneratedPluginRegistrant.register(with: self)
    return super.application(application, didFinishLaunchingWithOptions: launchOptions)
  }

to this

import UIKit
import Flutter

@main
@objc class AppDelegate: FlutterAppDelegate {
  override func application(
    _ application: UIApplication,
    didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
  ) -> Bool {
      GeneratedPluginRegistrant.register(with: self)
    return super.application(application, didFinishLaunchingWithOptions: launchOptions)
  }
Huey answered 10/9 at 9:38 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.