firebase / flutterfire

🔥 A collection of Firebase plugins for Flutter apps.
https://firebase.google.com/docs/flutter/setup
BSD 3-Clause "New" or "Revised" License
8.67k stars 3.97k forks source link

[firebase_app_check]: Debug Token isn't shown in the logs #13473

Closed notlikeamir closed 1 week ago

notlikeamir commented 1 week ago

Is there an existing issue for this?

Which plugins are affected?

App Check

Which platforms are affected?

iOS

Description

After that i updated my pubspec.yaml file, every time i run the app in debug mode it doesn't show the debug token of my ios simulator as before. Therefore i listed the names of the devices my self and added it to the App check page on firebase myself. but it doesn't seem to work.

Reproducing the issue

I run the app and the first expected should be the token that i need to add to firebase's App check.

Firebase Core version

3.6.0

Flutter Version

3.24.3

Relevant Log Output

No response

Flutter dependencies

Expand Flutter dependencies snippet
```yaml Dart SDK 3.5.3 Flutter SDK 3.24.3 jumirr 3.0.6+27 dependencies: - animations 2.0.11 [flutter] - app_settings 5.1.1 [flutter plugin_platform_interface] - auth_repo 1.0.0+1 [flutter cache equatable firebase_core firebase_auth cloud_firestore] - auto_size_text 3.0.0 [flutter] - bitmap 0.2.0 [flutter ffi] - bloc 8.1.4 [meta] - carousel_slider 5.0.0 [flutter] - cloud_firestore 5.4.4 [cloud_firestore_platform_interface cloud_firestore_web collection firebase_core firebase_core_platform_interface flutter meta] - country_picker 2.0.26 [collection universal_io flutter] - cupertino_icons 1.0.8 - delayed_display 2.0.0 [flutter] - equatable 2.0.5 [collection meta] - extended_image 8.3.1 [extended_image_library flutter meta] - firebase_analytics 11.3.3 [firebase_analytics_platform_interface firebase_analytics_web firebase_core firebase_core_platform_interface flutter] - firebase_app_check 0.3.1+3 [firebase_app_check_platform_interface firebase_app_check_web firebase_core firebase_core_platform_interface flutter] - firebase_auth 5.3.1 [firebase_auth_platform_interface firebase_auth_web firebase_core firebase_core_platform_interface flutter meta] - firebase_core 3.6.0 [firebase_core_platform_interface firebase_core_web flutter meta] - firebase_messaging 15.1.3 [firebase_core firebase_core_platform_interface firebase_messaging_platform_interface firebase_messaging_web flutter meta] - firebase_storage 12.3.2 [firebase_core firebase_core_platform_interface firebase_storage_platform_interface firebase_storage_web flutter] - flow_builder 0.1.0 [flutter] - flutter 0.0.0 [characters collection material_color_utilities meta vector_math sky_engine] - flutter_bloc 8.1.6 [bloc flutter provider] - flutter_cache_manager 3.4.1 [clock collection file flutter http path path_provider rxdart sqflite uuid] - flutter_feather_icons 2.0.0+1 [flutter] - flutter_image_compress 2.3.0 [flutter flutter_image_compress_platform_interface flutter_image_compress_common flutter_image_compress_web flutter_image_compress_macos flutter_image_compress_ohos] - flutter_map 7.0.2 [async collection dart_earcut flutter http latlong2 logger meta polylabel proj4dart vector_math] - flutter_native_splash 2.4.1 [args flutter flutter_web_plugins html image meta path universal_io xml yaml ansicolor] - flutter_svg 2.0.10+1 [flutter http vector_graphics vector_graphics_codec vector_graphics_compiler] - form_inputs 1.0.0+1 [flutter formz] - formz 0.7.0 [meta] - get 4.6.6 [flutter] - go_router 14.3.0 [collection flutter flutter_web_plugins logging meta] - hooks_riverpod 2.5.2 [collection flutter flutter_hooks flutter_riverpod riverpod state_notifier] - horizontal_blocked_scroll_physics 4.0.1 [flutter] - http 1.2.2 [async http_parser meta web] - image 4.2.0 [archive meta xml] - image_cropper 8.0.2 [flutter image_cropper_platform_interface image_cropper_for_web] - image_picker 1.1.2 [flutter image_picker_android image_picker_for_web image_picker_ios image_picker_linux image_picker_macos image_picker_platform_interface image_picker_windows] - intl 0.19.0 [clock meta path] - ip_country_lookup 1.0.3 [flutter dio] - latlong2 0.9.1 [intl] - numberpicker 2.1.2 [flutter infinite_listview] - path_provider 2.1.4 [flutter path_provider_android path_provider_foundation path_provider_linux path_provider_platform_interface path_provider_windows] - photo_view 0.15.0 [flutter] - reorderable_grid_view 2.2.8 [flutter] - reorderables 0.6.0 [flutter] - share_plus 10.0.2 [cross_file meta mime flutter flutter_web_plugins share_plus_platform_interface file url_launcher_web url_launcher_windows url_launcher_linux url_launcher_platform_interface ffi web win32] - shared_preferences 2.3.2 [flutter shared_preferences_android shared_preferences_foundation shared_preferences_linux shared_preferences_platform_interface shared_preferences_web shared_preferences_windows] - shimmer 3.0.0 [flutter] - smooth_page_indicator 1.2.0+3 [flutter] - spring 2.0.2 [simple_animations supercharged universal_platform vector_math flutter] - string_validator 1.1.0 - timeago 3.7.0 [intl] - tutorial_coach_mark 1.2.11 [flutter] - uni_links2 0.6.0+2 [uni_links2_platform_interface uni_links_web2 flutter] - url_launcher 6.3.0 [flutter url_launcher_android url_launcher_ios url_launcher_linux url_launcher_macos url_launcher_platform_interface url_launcher_web url_launcher_windows] - uuid 4.5.1 [crypto sprintf meta fixnum] dev dependencies: - flutter_launcher_icons 0.14.1 [args checked_yaml cli_util image json_annotation path yaml] - flutter_lints 4.0.0 [lints] - flutter_test 0.0.0 [flutter test_api matcher path fake_async clock stack_trace vector_math leak_tracker_flutter_testing async boolean_selector characters collection leak_tracker leak_tracker_testing material_color_utilities meta source_span stream_channel string_scanner term_glyph vm_service] transitive dependencies: - _flutterfire_internals 1.3.44 [collection firebase_core firebase_core_platform_interface flutter meta] - ansicolor 2.0.3 - archive 3.6.1 [crypto path] - args 2.5.0 - async 2.11.0 [collection meta] - boolean_selector 2.1.1 [source_span string_scanner] - cache 1.0.0+1 [flutter] - characters 1.3.0 - checked_yaml 2.0.3 [json_annotation source_span yaml] - cli_util 0.4.1 [meta path] - clock 1.1.1 - cloud_firestore_platform_interface 6.4.3 [_flutterfire_internals collection firebase_core flutter meta plugin_platform_interface] - cloud_firestore_web 4.3.2 [_flutterfire_internals cloud_firestore_platform_interface collection firebase_core firebase_core_web flutter flutter_web_plugins] - collection 1.18.0 - cross_file 0.3.4+2 [meta web] - crypto 3.0.5 [typed_data] - csslib 1.0.0 [source_span] - dart_earcut 1.1.0 - dio 5.7.0 [async http_parser meta path dio_web_adapter] - dio_web_adapter 2.0.0 [dio http_parser meta web] - extended_image_library 4.0.5 [crypto flutter http_client_helper js path path_provider web] - fake_async 1.3.1 [clock collection] - ffi 2.1.3 - file 7.0.0 [meta path] - file_selector_linux 0.9.3 [cross_file file_selector_platform_interface flutter] - file_selector_macos 0.9.4+2 [cross_file file_selector_platform_interface flutter] - file_selector_platform_interface 2.6.2 [cross_file flutter http plugin_platform_interface] - file_selector_windows 0.9.3+3 [cross_file file_selector_platform_interface flutter] - firebase_analytics_platform_interface 4.2.5 [_flutterfire_internals firebase_core flutter meta plugin_platform_interface] - firebase_analytics_web 0.5.10+2 [_flutterfire_internals firebase_analytics_platform_interface firebase_core firebase_core_web flutter flutter_web_plugins] - firebase_app_check_platform_interface 0.1.0+38 [_flutterfire_internals firebase_core flutter meta plugin_platform_interface] - firebase_app_check_web 0.1.3+2 [_flutterfire_internals firebase_app_check_platform_interface firebase_core firebase_core_web flutter flutter_web_plugins web] - firebase_auth_platform_interface 7.4.7 [_flutterfire_internals collection firebase_core flutter meta plugin_platform_interface] - firebase_auth_web 5.13.2 [firebase_auth_platform_interface firebase_core firebase_core_web flutter flutter_web_plugins http_parser meta web] - firebase_core_platform_interface 5.3.0 [collection flutter flutter_test meta plugin_platform_interface] - firebase_core_web 2.18.1 [firebase_core_platform_interface flutter flutter_web_plugins meta web] - firebase_messaging_platform_interface 4.5.46 [_flutterfire_internals firebase_core flutter meta plugin_platform_interface] - firebase_messaging_web 3.9.2 [_flutterfire_internals firebase_core firebase_core_web firebase_messaging_platform_interface flutter flutter_web_plugins meta web] - firebase_storage_platform_interface 5.1.31 [_flutterfire_internals collection firebase_core flutter meta plugin_platform_interface] - firebase_storage_web 3.10.2 [_flutterfire_internals async firebase_core firebase_core_web firebase_storage_platform_interface flutter flutter_web_plugins http meta web] - fixnum 1.1.0 - flutter_hooks 0.20.5 [flutter] - flutter_image_compress_common 1.0.5 [flutter flutter_image_compress_platform_interface] - flutter_image_compress_macos 1.0.2 [flutter flutter_image_compress_platform_interface] - flutter_image_compress_ohos 0.0.3 [flutter flutter_image_compress_platform_interface] - flutter_image_compress_platform_interface 1.0.5 [flutter plugin_platform_interface cross_file] - flutter_image_compress_web 0.1.4+1 [flutter flutter_web_plugins flutter_image_compress_platform_interface js] - flutter_plugin_android_lifecycle 2.0.23 [flutter] - flutter_riverpod 2.5.1 [collection flutter meta riverpod state_notifier] - flutter_web_plugins 0.0.0 [flutter characters collection material_color_utilities meta vector_math] - html 0.15.4 [csslib source_span] - http_client_helper 3.0.0 [http] - http_parser 4.0.2 [collection source_span string_scanner typed_data] - image_cropper_for_web 6.0.2 [flutter flutter_web_plugins image_cropper_platform_interface web] - image_cropper_platform_interface 7.0.0 [flutter plugin_platform_interface http] - image_picker_android 0.8.12+15 [flutter flutter_plugin_android_lifecycle image_picker_platform_interface] - image_picker_for_web 3.0.5 [flutter flutter_web_plugins image_picker_platform_interface mime web] - image_picker_ios 0.8.12 [flutter image_picker_platform_interface] - image_picker_linux 0.2.1+1 [file_selector_linux file_selector_platform_interface flutter image_picker_platform_interface] - image_picker_macos 0.2.1+1 [file_selector_macos file_selector_platform_interface flutter image_picker_platform_interface] - image_picker_platform_interface 2.10.0 [cross_file flutter http plugin_platform_interface] - image_picker_windows 0.2.1+1 [file_selector_platform_interface file_selector_windows flutter image_picker_platform_interface] - infinite_listview 1.1.0 [flutter] - js 0.7.1 - json_annotation 4.9.0 [meta] - leak_tracker 10.0.5 [clock collection meta path vm_service] - leak_tracker_flutter_testing 3.0.5 [flutter leak_tracker leak_tracker_testing matcher meta] - leak_tracker_testing 3.0.1 [leak_tracker matcher meta] - lints 4.0.0 - lists 1.0.1 [meta] - logger 2.4.0 - logging 1.2.0 - matcher 0.12.16+1 [async meta stack_trace term_glyph test_api] - material_color_utilities 0.11.1 [collection] - meta 1.15.0 - mgrs_dart 2.0.0 [unicode] - mime 1.0.6 - nested 1.0.0 [flutter] - path 1.9.0 - path_parsing 1.0.1 [vector_math meta] - path_provider_android 2.2.11 [flutter path_provider_platform_interface] - path_provider_foundation 2.4.0 [flutter path_provider_platform_interface] - path_provider_linux 2.2.1 [ffi flutter path path_provider_platform_interface xdg_directories] - path_provider_platform_interface 2.1.2 [flutter platform plugin_platform_interface] - path_provider_windows 2.3.0 [ffi flutter path path_provider_platform_interface] - pedantic 1.11.1 - petitparser 6.0.2 [meta] - platform 3.1.5 - plugin_platform_interface 2.1.8 [meta] - polylabel 1.0.1 [collection] - proj4dart 2.1.0 [mgrs_dart wkt_parser meta] - provider 6.1.2 [collection flutter nested] - riverpod 2.5.1 [collection meta stack_trace state_notifier] - rxdart 0.28.0 - share_plus_platform_interface 5.0.0 [cross_file flutter meta mime plugin_platform_interface path_provider uuid] - shared_preferences_android 2.3.3 [flutter shared_preferences_platform_interface] - shared_preferences_foundation 2.5.3 [flutter shared_preferences_platform_interface] - shared_preferences_linux 2.4.1 [file flutter path path_provider_linux path_provider_platform_interface shared_preferences_platform_interface] - shared_preferences_platform_interface 2.4.1 [flutter plugin_platform_interface] - shared_preferences_web 2.4.2 [flutter flutter_web_plugins shared_preferences_platform_interface web] - shared_preferences_windows 2.4.1 [file flutter path path_provider_platform_interface path_provider_windows shared_preferences_platform_interface] - simple_animations 3.1.1 [flutter supercharged pedantic] - sky_engine 0.0.99 - source_span 1.10.0 [collection path term_glyph] - sprintf 7.0.0 - sqflite 2.3.3+2 [flutter sqflite_common path] - sqflite_common 2.5.4+4 [synchronized path meta] - stack_trace 1.11.1 [path] - state_notifier 1.0.0 [meta] - stream_channel 2.1.2 [async] - string_scanner 1.2.0 [source_span] - supercharged 2.1.1 [supercharged_dart flutter] - supercharged_dart 2.1.1 - synchronized 3.3.0+3 - term_glyph 1.2.1 - test_api 0.7.2 [async boolean_selector collection meta source_span stack_trace stream_channel string_scanner term_glyph] - typed_data 1.3.2 [collection] - uni_links2_platform_interface 1.0.0+2 [plugin_platform_interface flutter] - uni_links_web2 0.1.0+2 [uni_links2_platform_interface flutter flutter_web_plugins] - unicode 0.3.1 [lists] - universal_io 2.2.2 [collection meta typed_data] - universal_platform 1.1.0 - url_launcher_android 6.3.12 [flutter url_launcher_platform_interface] - url_launcher_ios 6.3.1 [flutter url_launcher_platform_interface] - url_launcher_linux 3.2.0 [flutter url_launcher_platform_interface] - url_launcher_macos 3.2.1 [flutter url_launcher_platform_interface] - url_launcher_platform_interface 2.3.2 [flutter plugin_platform_interface] - url_launcher_web 2.3.3 [flutter flutter_web_plugins url_launcher_platform_interface web] - url_launcher_windows 3.1.2 [flutter url_launcher_platform_interface] - vector_graphics 1.1.11+1 [flutter http vector_graphics_codec] - vector_graphics_codec 1.1.11+1 - vector_graphics_compiler 1.1.11+1 [args meta path_parsing xml vector_graphics_codec path] - vector_math 2.1.4 - vm_service 14.2.5 - web 1.1.0 - win32 5.5.5 [ffi] - wkt_parser 2.0.0 - xdg_directories 1.1.0 [meta path] - xml 6.5.0 [collection meta petitparser] - yaml 3.1.2 [collection source_span string_scanner] ```

Additional context and comments

No response

SelaseKay commented 1 week ago

Hi @notlikeamir , thanks for the report. I'm unable to reproduce this issue. Kindly provide a sample code reproducing this issue.

yasin-snck commented 1 week ago

I have the same issue.

On my IOS device (emulator or real device, it doesn't matter), the token is logged when the app is first loaded, but it is never logged again after the first load.

The same problem occurs in release. As a result of any situation, AppCheck is not activated and 'HTTP 403' error is returned from my services using AppCheck.

https://stackoverflow.com/questions/79066932/flutter-firebase-app-check-app-attestation-failed-403-permission-denied-erro

notlikeamir commented 1 week ago

It happens when i initialise the app check in my main:

await FirebaseAppCheck.instance.activate( appleProvider: AppleProvider.debug, );

And for me the token is never logged.

SelaseKay commented 1 week ago

I'm still unable to reproduce this behaviour on my end. Kindly provide a sample minimal code reproducing this behaviour.

notlikeamir commented 1 week ago

I'm not sure how exactly i can reproduce it since i have a very large project, it only happens after i initialise my firebase app in the main :

void main() async { WidgetsFlutterBinding.ensureInitialized(); Bloc.observer = AppBlocObserver(); await Firebase.initializeApp( options: DefaultFirebaseOptions.currentPlatform, ); await FirebaseAppCheck.instance.activate( appleProvider: AppleProvider.debug, ); } Can you please guide me on what you need so i can provide it. I'm not really sure how where the issue might be. The things i changed after my update of xcode and flutter was setting the value CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES because i get an error running the app when the value is NO.

SelaseKay commented 1 week ago

Kindly change it back to NO and try again. That has been resolved in the latest update.

notlikeamir commented 1 week ago

Okay thank you, it's not working

kaevensen commented 1 week ago

Im having the same issue. Did you resolve this with the CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO or was there something else. The resolution is not clear. Im having the same issue and I haven't set the above setting to Yes. Im getting a debug token for android but not iOS.