feat: AppCheck Debug provider in Simulators
jjgriff93 opened this issue · comments
James Griffin commented
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
- I have read and followed the feature request guidelines.
- I have attached links to possibly related issues and discussions.
Robin Genz commented
You can already select the debug provider using the initialize method. I'm therefore closing this issue.