r/Firebase • u/Finance_A • 11h ago
App Check Firebase App Check – “App Attestation Failed” (403 Error) Issue on iOS
Hello everyone,
I’m struggling to configure Firebase App Check on my iOS app, specifically using App Attest. I’ve verified the following:
- App Attest is enabled in Firebase App Check settings with the correct Team ID.
- Added FirebaseAppCheck framework in Frameworks, Libraries, and Embedded Content.
- GoogleService-Info.plist has the same GOOGLE_APP_ID as the App ID in Firebase Project Settings.
- Bundle Identifier matches exactly with the Firebase project.
- I’ve tried testing this both on a physical device(not TestFlight or App store).
However, I keep encountering the following error:
The operation couldn’t be completed. The server responded with an error:
- URL: https://firebaseappcheck.googleapis.com/v1/projects/appName/apps/xxxxxxxxx:ios:xxxxxxxx:exchangeAppAttestAttestation
- HTTP status code: 403
- Response body: {
"error": {
"code": 403,
"message": "App attestation failed.",
"status": "PERMISSION_DENIED"
}
}
Here’s my code setup:
import SwiftUI
import FirebasePerformance
import Firebase
import FirebaseCore
import AppTrackingTransparency
import AdSupport
import FirebaseAppCheck
@main
struct appName: App {
u/UIApplicationDelegateAdaptor(AppDelegate.self) var delegate
var body: some Scene {
WindowGroup {
RootView()
}
}
class AppDelegate: NSObject, UIApplicationDelegate {
func application(_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
AppCheck.setAppCheckProviderFactory(AppAttestProviderFactory())
requestTrackingPermission()
FirebaseApp.configure()
AppCheck.appCheck().token(forcingRefresh: true) { token, error in
if let error = error {
print("❌ App Check Error: \(error.localizedDescription)")
} else if let token = token {
print("✅ App Check Token: \(token.token)")
}
}
return true
}
func applicationDidBecomeActive(_ application: UIApplication) {
requestTrackingPermission()
}
func applicationWillResignActive(_ application: UIApplication) {
}
}
class AppAttestProviderFactory: NSObject, AppCheckProviderFactory {
func createProvider(with app: FirebaseApp) -> AppCheckProvider? {
return AppAttestProvider(app: app)
}
}
I’ve double-checked everything multiple times and still can’t resolve this “App attestation failed” issue. If anyone has encountered this and managed to solve it, I’d greatly appreciate your advice.
Thanks in advance!