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

bug: "DeviceCheckProvider is not supported" when running on Simulator with debug enabled #631

Closed
5 of 16 tasks
jjgriff93 opened this issue May 23, 2024 · 2 comments
Closed
5 of 16 tasks
Labels
bug/fix Something isn't working duplicate This issue or pull request already exists needs: triage package: app-check platform: ios iOS platform

Comments

@jjgriff93
Copy link

jjgriff93 commented May 23, 2024

Plugin(s)

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

Version

6.0.0

Platform(s)

  • Android
  • iOS
  • Web

Current behavior

Even when initialising app check as per https://github.com/robingenz/capacitor-firebase-plugin-demo/blob/main/src/app/modules/firebase-app-check/firebase-app-check.page.ts, when running in an iOS 17 simulator I get

[error] - {"errorMessage":"The operation couldn’t be completed. The attestation provider DeviceCheckProvider is not supported on current platform and OS version.","message":"The operation couldn’t be completed. The attestation provider DeviceCheckProvider is not supported on current platform and OS version."}
⚡️  [error] - [2024-05-23T15:57:17.076Z]  @firebase/app-check: {"errorMessage":"The operation couldn’t be completed. The attestation provider DeviceCheckProvider is not supported on current platform and OS version."}

This is despite setting debug to true on initialise:

FirebaseAppCheck.initialize({
    debug: true
  }

Which should use the AppCheckDebugProviderFactory. It should also be using AppAttest instead of DeviceCheck however after reading up on some similar issues I believe that's a red herring. It seems that the real issue is that in this plugin, Firebase.configure() is being called BEFORE the AppCheck provider factory is being initialised, which makes it default to DeviceCheck, when as per the docs it should be called after.

I think the solution will simply be to remove the override init that configures firebase before calling the initialize provider function. I've tested adding the DebugProvider init code to my AppDelegate so that it happens before the Capacitor code is executed and that has worked.

Expected behavior

For the AppCheckDebugProvider to be used as expected when debug is enabled.

Reproduction

https://github.com/robingenz/capacitor-firebase-plugin-demo

Steps to reproduce

  1. Build the repo and cap sync ios
  2. Run in an iPhone simulator

Other information

No response

Capacitor doctor

💊 Capacitor Doctor 💊

Latest Dependencies:

@capacitor/cli: 6.0.0
@capacitor/core: 6.0.0
@capacitor/android: 6.0.0
@capacitor/ios: 6.0.0

Installed Dependencies:

@capacitor/cli: 6.0.0
@capacitor/ios: 6.0.0
@capacitor/android: 6.0.0
@capacitor/core: 6.0.0

[success] iOS looking great! 👌
[success] Android looking great! 👌

Before submitting

  • I have read and followed the bug report guidelines.
  • I have attached links to possibly related issues and discussions.
  • I understand that incomplete issues (e.g. without reproduction) are closed.
@robingenz
Copy link
Member

It seems that the real issue is that in this plugin, Firebase.configure() is being called BEFORE the AppCheck provider factory is being initialised, which makes it default to DeviceCheck, when as per the docs it should be called after.

Yes, this is a known issue. We'll fix this in the future. I close this as duplicate of #453.

@robingenz robingenz closed this as not planned Won't fix, can't repro, duplicate, stale May 25, 2024
@robingenz robingenz added the duplicate This issue or pull request already exists label May 25, 2024
@boblepepeur
Copy link

Same for me

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug/fix Something isn't working duplicate This issue or pull request already exists needs: triage package: app-check platform: ios iOS platform
Projects
None yet
Development

No branches or pull requests

3 participants