Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: AppCheck Debug provider in Simulators #630

Closed
3 of 12 tasks
jjgriff93 opened this issue May 23, 2024 · 1 comment
Closed
3 of 12 tasks

feat: AppCheck Debug provider in Simulators #630

jjgriff93 opened this issue May 23, 2024 · 1 comment

Comments

@jjgriff93
Copy link

Plugin(s)

  • Analytics
  • App
  • App Check
  • Authentication
  • Crashlytics
  • Cloud Firestore
  • Cloud Messaging
  • Cloud Storage
  • Performance
  • Remote Config

Current problem

Currently this package does not work when running the Capacitor code from an iOS simulator, unless the debug flag is set when calling FirebaseAppCheck.initialize(). This is because simulators only support running with the AppCheckDebugProvider and will fail any real device checks.

Preferred solution

As per the Firebase docs, the following code could be implemented:

class MyAppCheckProviderFactory: NSObject, AppCheckProviderFactory {
  func createProvider(with app: FirebaseApp) -> AppCheckProvider? {
    #if targetEnvironment(simulator)
      // App Attest is not available on simulators.
      // Use a debug provider.
      return AppCheckDebugProvider(app: app)
    #else
      // Use App Attest provider on real devices.
      return AppAttestProvider(app: app)
    #endif
  }
}

Alternative options

No response

Additional context

No response

Before submitting

@robingenz
Copy link
Member

robingenz commented May 23, 2024

You can already select the debug provider using the initialize method. I'm therefore closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants