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

[firebase_app_check]: Firebase AppCheck Token Retrieval Issue on iOS #13438

Open
1 task done
synstin opened this issue Oct 1, 2024 · 0 comments
Open
1 task done

[firebase_app_check]: Firebase AppCheck Token Retrieval Issue on iOS #13438

synstin opened this issue Oct 1, 2024 · 0 comments
Labels
Needs Attention This issue needs maintainer attention. platform: ios Issues / PRs which are specifically for iOS. plugin: app_check type: bug Something isn't working

Comments

@synstin
Copy link

synstin commented Oct 1, 2024

Is there an existing issue for this?

  • I have searched the existing issues.

Which plugins are affected?

App Check

Which platforms are affected?

iOS

Description

We are experiencing significant delays in retrieving Firebase AppCheck tokens on iOS devices. The token retrieval process is taking between 300ms to 500ms, which seems unusually slow compared to the performance on Android devices. This delay occurs consistently, even when retrieving cached tokens.

Reproducing the issue

Implement Firebase AppCheck in an iOS application.
Measure the time taken to retrieve an AppCheck token.
Repeat the token retrieval process multiple times.
Compare the results with the same process on an Android device.
Observations:

iOS devices (both simulator and real devices in release mode) consistently show 300-500ms retrieval times.
Android devices show an initial delay, but subsequent retrievals are much faster (1-10ms).
The slow retrieval on iOS persists even when fetching the same (presumably cached) token.

Test Environment:

iOS Version: 18.0
Tested on both iOS simulator and real devices in release mode

Firebase Core version

3.6.0

Flutter Version

3.24.3

Relevant Log Output

IOS


flutter:     await FirebaseAppCheck.instance.getToken()
    elapsedMilliseconds: 446ms
flutter:     await FirebaseAppCheck.instance.getToken()
    elapsedMilliseconds: 536ms
flutter:     await FirebaseAppCheck.instance.getToken()
    elapsedMilliseconds: 512ms
flutter:     await FirebaseAppCheck.instance.getToken()
    elapsedMilliseconds: 322ms
flutter:     await FirebaseAppCheck.instance.getToken()
    elapsedMilliseconds: 466ms
flutter:     await FirebaseAppCheck.instance.getToken()
    elapsedMilliseconds: 255ms

ANDROID

I/flutter ( 8473):     await FirebaseAppCheck.instance.getToken()
I/flutter ( 8473):     elapsedMilliseconds: 87ms
I/flutter ( 8473):     
I/flutter ( 8473):     await FirebaseAppCheck.instance.getToken()
I/flutter ( 8473):     elapsedMilliseconds: 2ms
I/flutter ( 8473):     
I/flutter ( 8473):     await FirebaseAppCheck.instance.getToken()
I/flutter ( 8473):     elapsedMilliseconds: 1ms
await FirebaseAppCheck.instance.getToken()
I/flutter ( 8473):     elapsedMilliseconds: 1ms
I/flutter ( 8473):     
I/flutter ( 8473):     await FirebaseAppCheck.instance.getToken()
I/flutter ( 8473):     elapsedMilliseconds: 1ms
I/flutter ( 8473):     
I/flutter ( 8473):     await FirebaseAppCheck.instance.getToken()
I/flutter ( 8473):     elapsedMilliseconds: 20ms
I/flutter ( 8473):     
I/flutter ( 8473):     await FirebaseAppCheck.instance.getToken()
I/flutter ( 8473):     elapsedMilliseconds: 1ms


### Flutter dependencies

  # firebase
  firebase_core: 3.6.0
  firebase_database: 11.1.4
  firebase_messaging: 15.1.3
  firebase_analytics: 11.3.3
  firebase_app_check: 0.3.1+3

### Additional context and comments

This issue significantly impacts the performance of our app on iOS devices.
The stark difference between iOS and Android performance is concerning.
We've tested this on both the iOS simulator and real devices in release mode, with consistent results.
We're unsure if this is expected behavior for Firebase AppCheck on iOS or if it's an anomaly.
Any insights into the cause of this discrepancy or suggestions for improving token retrieval speed on iOS would be greatly appreciated.
If this is normal behavior, we'd like to understand why there's such a significant difference between iOS and Android performance.
@synstin synstin added Needs Attention This issue needs maintainer attention. type: bug Something isn't working labels Oct 1, 2024
@SelaseKay SelaseKay added platform: ios Issues / PRs which are specifically for iOS. plugin: app_check labels Oct 1, 2024
@synstin synstin changed the title [AppCheck]: Firebase AppCheck Token Retrieval Issue on iOS [firebase_app_check]: Firebase AppCheck Token Retrieval Issue on iOS Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Attention This issue needs maintainer attention. platform: ios Issues / PRs which are specifically for iOS. plugin: app_check type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants