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.7k stars 3.97k forks source link

šŸ› [Firebase_mesaging] [firebase_messaging/missing-device-id] An unknown error has occurred. #6774

Closed tuanhwing closed 3 years ago

tuanhwing commented 3 years ago

Bug report

Describe the bug Firebase messaging subscribing to topic does not seem to work on iOS. But Android work fine. I am facing a problem when subscribing to topic by firebaseMessaging.subscribeToTopic('weather'); exception: [firebase_messaging/missing-device-id] An unknown error has occurred.

Steps to reproduce


Flutter doctor

Run flutter doctor and paste the output below:

Screen Shot 2021-08-06 at 20 09 23


Flutter dependencies

Run flutter pub deps -- --style=compact and paste the output below:

dependencies:
- advance_pdf_viewer 2.0.0 [flutter flutter_cache_manager numberpicker path_provider]
- advertising_id 0.9.2 [flutter]
- app_settings 4.1.1 [flutter]
- assets_audio_player 3.0.3+3 [flutter rxdart uuid http path_provider assets_audio_player_web]
- cached_network_image 3.1.0 [flutter flutter_cache_manager octo_image cached_network_image_platform_interface cached_network_image_web]
- camera 0.8.1+7 [camera_platform_interface flutter pedantic quiver]
- cupertino_icons 0.1.3
- data 0.0.1 [flutter flutter_sdk]
- date_format 1.0.9
- date_time_picker 1.1.1 [flutter intl]
- device_info 2.0.2 [flutter device_info_platform_interface]
- dio 4.0.0 [http_parser path]
- equatable 2.0.3 [collection meta]
- event_bus 1.1.1
- exif 1.0.3 [args collection convert sprintf]
- file_picker 3.0.4 [flutter flutter_web_plugins flutter_plugin_android_lifecycle plugin_platform_interface]
- firebase_plugin 1.0.0+1 [flutter firebase_core firebase_analytics firebase_messaging firebase_crashlytics]
- fl_chart 0.36.3 [flutter equatable pedantic]
- flutter 0.0.0 [characters collection meta typed_data vector_math sky_engine]
- flutter_cache_manager 3.1.2 [clock collection file flutter http path path_provider pedantic rxdart sqflite uuid]
- flutter_datetime_picker 1.5.1 [flutter]
- flutter_keyboard_visibility 5.0.3 [meta flutter_keyboard_visibility_platform_interface flutter_keyboard_visibility_web flutter]
- flutter_localizations 0.0.0 [flutter intl characters clock collection meta path typed_data vector_math]
- flutter_rating_bar 4.0.0 [flutter]
- flutter_sdk 1.0.0 [flutter sqflite dio device_info shared_preferences rxdart get_it uuid global_configuration path_provider json_annotation visibility_detector flutter_spinkit intl secure_storage equatable connectivity]
- flutter_typeahead 3.2.0 [flutter flutter_keyboard_visibility]
- fluttertoast 7.1.8 [flutter flutter_web_plugins]
- formz 0.3.2
- image 3.0.2 [archive meta xml]
- image_picker 0.8.1 [flutter flutter_plugin_android_lifecycle image_picker_for_web image_picker_platform_interface]
- kana_kit 2.0.0 [equatable]
- month_picker_dialog 0.4.0 [flutter flutter_localizations intl rxdart]
- package_info 0.4.3+4 [flutter]
- path 1.8.0
- path_provider 2.0.2 [flutter path_provider_platform_interface path_provider_macos path_provider_linux path_provider_windows]
- permission_handler 6.1.3 [flutter meta permission_handler_platform_interface]
- pull_to_refresh 2.0.0 [flutter]
- scandit_flutter_plugin 6.8.0 [flutter meta scandit_flutter_datacapture_core]
- settings_ui 0.3.0 [flutter]
- shared_preferences 0.5.7+3 [meta flutter shared_preferences_platform_interface shared_preferences_macos shared_preferences_web]
- shimmer 2.0.0 [flutter]
- smooth_page_indicator 0.2.3 [flutter]
- visibility_detector 0.1.5 [flutter]
- webview_flutter 2.0.10 [flutter]

dev dependencies:
- flutter_oss_licenses 1.0.1 [path meta yaml]
- flutter_test 0.0.0 [flutter test_api path fake_async clock stack_trace vector_math async boolean_selector characters charcode collection matcher meta source_span stream_channel string_scanner term_glyph typed_data]

dependency overrides:
- intl 0.17.0 [clock path]

transitive dependencies:
- archive 3.1.2 [crypto path]
- args 1.6.0
- assets_audio_player_web 3.0.3+6 [flutter flutter_web_plugins]
- async 2.5.0 [collection]
- boolean_selector 2.1.0 [source_span string_scanner]
- cached_network_image_platform_interface 1.0.0 [flutter flutter_cache_manager]
- cached_network_image_web 1.0.1 [flutter flutter_cache_manager cached_network_image_platform_interface]
- camera_platform_interface 2.1.0 [cross_file flutter meta plugin_platform_interface stream_transform]
- characters 1.1.0
- charcode 1.2.0
- clock 1.1.0
- collection 1.15.0
- connectivity 3.0.6 [flutter meta connectivity_platform_interface connectivity_macos connectivity_for_web]
- connectivity_for_web 0.4.0 [connectivity_platform_interface flutter_web_plugins flutter]
- connectivity_macos 0.2.0 [flutter]
- connectivity_platform_interface 2.0.0 [flutter meta plugin_platform_interface]
- convert 2.1.1 [charcode typed_data]
- cross_file 0.3.1+4 [flutter meta]
- crypto 3.0.1 [collection typed_data]
- device_info_platform_interface 2.0.1 [flutter meta plugin_platform_interface]
- fake_async 1.2.0 [clock collection]
- ffi 1.1.2
- file 6.1.2 [meta path]
- firebase 9.0.1 [http http_parser js]
- firebase_analytics 8.2.0 [firebase_analytics_platform_interface firebase_analytics_web firebase_core flutter meta]
- firebase_analytics_platform_interface 2.0.1 [flutter meta]
- firebase_analytics_web 0.3.0+1 [firebase firebase_analytics_platform_interface flutter flutter_web_plugins meta]
- firebase_core 1.4.0 [firebase_core_platform_interface firebase_core_web flutter meta]
- firebase_core_platform_interface 4.0.1 [collection flutter meta plugin_platform_interface]
- firebase_core_web 1.1.0 [firebase_core_platform_interface flutter flutter_web_plugins js meta]
- firebase_crashlytics 2.1.1 [firebase_core firebase_core_platform_interface firebase_crashlytics_platform_interface flutter stack_trace]
- firebase_crashlytics_platform_interface 3.1.0 [collection firebase_core flutter meta plugin_platform_interface]
- firebase_messaging 10.0.4 [firebase_core firebase_core_platform_interface firebase_messaging_platform_interface firebase_messaging_web flutter meta]
- firebase_messaging_platform_interface 3.0.3 [firebase_core flutter meta plugin_platform_interface]
- firebase_messaging_web 2.0.3 [firebase_core firebase_core_web firebase_messaging_platform_interface flutter flutter_web_plugins js meta]
- flutter_blurhash 0.6.0 [flutter meta pedantic]
- flutter_keyboard_visibility_platform_interface 2.0.0 [flutter meta plugin_platform_interface]
- flutter_keyboard_visibility_web 2.0.0 [flutter_keyboard_visibility_platform_interface flutter_web_plugins flutter]
- flutter_plugin_android_lifecycle 2.0.2 [flutter]
- flutter_spinkit 4.1.2+1 [flutter]
- flutter_web_plugins 0.0.0 [flutter js characters collection meta typed_data vector_math]
- get_it 5.0.6 [async meta]
- global_configuration 2.0.0-nullsafety.1 [flutter http]
- http 0.13.3 [async http_parser meta path pedantic]
- http_parser 4.0.0 [charcode collection source_span string_scanner typed_data]
- image_picker_for_web 2.1.2 [flutter flutter_web_plugins image_picker_platform_interface meta]
- image_picker_platform_interface 2.2.0 [flutter http meta plugin_platform_interface cross_file]
- infinite_listview 1.1.0 [flutter]
- js 0.6.3
- json_annotation 3.1.1
- matcher 0.12.10 [stack_trace]
- meta 1.3.0
- numberpicker 2.1.1 [flutter infinite_listview]
- octo_image 1.0.0+1 [flutter flutter_blurhash]
- path_provider_linux 2.0.2 [flutter path path_provider_platform_interface xdg_directories]
- path_provider_macos 2.0.2 [flutter]
- path_provider_platform_interface 2.0.1 [flutter meta platform plugin_platform_interface]
- path_provider_windows 2.0.3 [ffi flutter meta path path_provider_platform_interface win32]
- pedantic 1.11.1
- permission_handler_platform_interface 3.6.1 [flutter meta plugin_platform_interface]
- petitparser 4.1.0 [meta]
- platform 3.0.0
- plugin_platform_interface 2.0.1 [meta]
- process 4.2.3 [file path platform]
- quiver 3.0.1 [matcher]
- rxdart 0.26.0
- scandit_flutter_datacapture_core 6.8.1 [flutter meta]
- secure_storage 0.0.1 [flutter]
- shared_preferences_macos 0.0.1+11 [shared_preferences_platform_interface flutter]
- shared_preferences_platform_interface 1.0.4 [meta flutter]
- shared_preferences_web 0.1.2+7 [shared_preferences_platform_interface flutter flutter_web_plugins meta]
- sky_engine 0.0.99
- source_span 1.8.0 [charcode collection path term_glyph]
- sprintf 4.1.0
- sqflite 2.0.0+3 [flutter sqflite_common path]
- sqflite_common 2.0.0+2 [synchronized path meta]
- stack_trace 1.10.0 [path]
- stream_channel 2.1.0 [async]
- stream_transform 2.0.0
- string_scanner 1.1.0 [charcode source_span]
- synchronized 3.0.0
- term_glyph 1.2.0
- test_api 0.2.19 [async boolean_selector collection meta path source_span stack_trace stream_channel string_scanner term_glyph matcher]
- typed_data 1.3.0 [collection]
- uuid 3.0.4 [crypto]
- vector_math 2.1.0
- win32 2.0.5 [ffi]
- xdg_directories 0.2.0 [meta path process]
- xml 5.1.2 [collection meta petitparser]
- yaml 3.1.0 [collection source_span string_scanner]


darshankawar commented 3 years ago

@tuanhwing firebaseMessaging.subscribeToTopic('weather'); doesn't seem to be the correct implementation to subscribe.

Try like this: await FirebaseMessaging.instance.subscribeToTopic('weather'); and see this document link for your reference: https://firebase.flutter.dev/docs/messaging/usage#subscribing-to-topics and see if it works for you.

Thanks.

google-oss-bot commented 3 years ago

Hey @tuanhwing. We need more information to resolve this issue but there hasn't been an update in 7 weekdays. I'm marking the issue as stale and if there are no new updates in the next 7 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

google-oss-bot commented 3 years ago

Since there haven't been any recent updates here, I am going to close this issue.

@tuanhwing if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this.