flutterfire
flutterfire copied to clipboard
[firebase_messaging]: Receiving fcm notification on network change (macos)
Is there an existing issue for this?
- [x] I have searched the existing issues.
Which plugins are affected?
Messaging
Which platforms are affected?
No response
Description
https://github.com/firebase/flutterfire/issues/11965 facing the same issue on sonoma 14.3, any update on this?
Reproducing the issue
- Create a flutter app for macos
- Initialize firebase, request notification permission, generate APNS token & call getToken
- Use firebase console to trigger the notification
- Will not receive notification
- Connect to a VPN & then disconnect, the notification will be received.
Firebase Core version
2.32.0
Flutter Version
3.29.0
Relevant Log Output
Flutter dependencies
Expand Flutter dependencies snippet
Dart SDK 3.7.0
Flutter SDK 3.29.0
notification 1.0.0+1
dependencies:
- cloud_firestore 4.17.5 [cloud_firestore_platform_interface cloud_firestore_web collection firebase_core firebase_core_platform_interface flutter meta]
- cupertino_icons 1.0.8
- firebase_core 2.32.0 [firebase_core_platform_interface firebase_core_web flutter meta]
- firebase_messaging 14.7.10 [firebase_core firebase_core_platform_interface firebase_messaging_platform_interface firebase_messaging_web flutter meta]
- firebase_storage 11.6.5 [firebase_core firebase_core_platform_interface firebase_storage_platform_interface firebase_storage_web flutter]
- flutter 0.0.0 [characters collection material_color_utilities meta vector_math sky_engine]
- flutter_dotenv 5.2.1 [flutter]
- http 1.3.0 [async http_parser meta web]
- protobuf 3.1.0 [collection fixnum meta]
- shared_preferences 2.5.1 [flutter shared_preferences_android shared_preferences_foundation shared_preferences_linux shared_preferences_platform_interface shared_preferences_web shared_preferences_windows]
- synchronized 3.3.0+3
- xml 6.5.0 [collection meta petitparser]
dev dependencies:
- flutter_lints 5.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.35 [collection firebase_core firebase_core_platform_interface flutter meta]
- async 2.12.0 [collection meta]
- boolean_selector 2.1.2 [source_span string_scanner]
- characters 1.4.0
- clock 1.1.2
- cloud_firestore_platform_interface 6.2.5 [_flutterfire_internals collection firebase_core flutter meta plugin_platform_interface]
- cloud_firestore_web 3.12.5 [_flutterfire_internals cloud_firestore_platform_interface collection firebase_core firebase_core_web flutter flutter_web_plugins]
- collection 1.19.1
- fake_async 1.3.2 [clock collection]
- ffi 2.1.3
- file 7.0.1 [meta path]
- firebase_core_platform_interface 5.4.0 [collection flutter flutter_test meta plugin_platform_interface]
- firebase_core_web 2.20.0 [firebase_core_platform_interface flutter flutter_web_plugins meta web]
- firebase_messaging_platform_interface 4.5.37 [_flutterfire_internals firebase_core flutter meta plugin_platform_interface]
- firebase_messaging_web 3.5.18 [_flutterfire_internals firebase_core firebase_core_web firebase_messaging_platform_interface flutter flutter_web_plugins js meta]
- firebase_storage_platform_interface 5.1.22 [_flutterfire_internals collection firebase_core flutter meta plugin_platform_interface]
- firebase_storage_web 3.6.22 [_flutterfire_internals async firebase_core firebase_core_web firebase_storage_platform_interface flutter flutter_web_plugins http js meta]
- fixnum 1.1.1
- flutter_web_plugins 0.0.0 [flutter characters collection material_color_utilities meta vector_math]
- http_parser 4.1.2 [collection source_span string_scanner typed_data]
- js 0.6.7 [meta]
- leak_tracker 10.0.8 [clock collection meta path vm_service]
- leak_tracker_flutter_testing 3.0.9 [flutter leak_tracker leak_tracker_testing matcher meta]
- leak_tracker_testing 3.0.1 [leak_tracker matcher meta]
- lints 5.1.1
- matcher 0.12.17 [async meta stack_trace term_glyph test_api]
- material_color_utilities 0.11.1 [collection]
- meta 1.16.0
- path 1.9.1
- 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]
- petitparser 6.0.2 [meta]
- platform 3.1.6
- plugin_platform_interface 2.1.8 [meta]
- shared_preferences_android 2.4.4 [flutter shared_preferences_platform_interface]
- shared_preferences_foundation 2.5.4 [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]
- sky_engine 0.0.0
- source_span 1.10.1 [collection path term_glyph]
- stack_trace 1.12.1 [path]
- stream_channel 2.1.4 [async]
- string_scanner 1.4.1 [source_span]
- term_glyph 1.2.2
- test_api 0.7.4 [async boolean_selector collection meta source_span stack_trace stream_channel string_scanner term_glyph]
- typed_data 1.4.0 [collection]
- vector_math 2.1.4
- vm_service 14.3.1
- web 1.1.0
- xdg_directories 1.1.0 [meta path]
Additional context and comments
No response
I have updated the macos version to 15.3.1 and also tried factory resetting the device but still facing the same issue
@daniel-kane-everbridge-com have you resolved this issue?
any update?
any suggestions will be appreciated
We found that the issue was with the Mac not receiving the notification, so not to do with firebase specifically. No solution that I know of yet https://developer.apple.com/forums/thread/740923
@daniel-kane-everbridge-com Thanks for the reply. is there any workaround for this issue? what you have done to fix your problem?
Hey there, have you tried testing it out on iOS and maybe even Android. This could help us determine whether it is a macOS specific issue or not. @harsh-im
@MichaelVerdon Hi, I’ve used FCM notifications on the Android platform and haven’t encountered any such issues there. I’m not entirely sure about iOS, but based on the thread shared by @daniel-kane-eb, it appears to be a macOS-specific problem. Everything was working fine for me on macOS 13.6 Ventura, but I started facing this issue after upgrading to macOS 14 and later versions.
@MichaelVerdon any update on this?
Hi there, when testing notifications I usually like to use the CURL command to do so. Here is an example:
curl -X POST "https://fcm.googleapis.com/v1/projects/flutterfire-e2e-tests/messages:send" \
-H "Authorization: Bearer <gcloud-auth-token>" \
-H "Content-Type: application/json; charset=utf-8" \
-d '{
"message": {
"token": "<fcm-token-here>",
"apns": {
"headers": {
"apns-priority": "5"
},
"payload": {
"aps": {
"content-available": 1
}
}
},
"data": {
"type": "background_update",
"content": "Hello from a silent push!"
}
}
}'
Can you try sending a notification like this or similar and tell me if its received or not? I usually have issues myself when trying to send a notification on the console but sending these has been way mroe reliable for me.
@MichaelVerdon I have tried sending notification using go's firebase sdk, I think it may be using the same API under the hood and the result of it was the same i.e. I wasn't getting notifications randomly.
@MichaelVerdon I have tried sending notification using go's firebase sdk, I think it may be using the same API under the hood and the result of it was the same i.e. I wasn't getting notifications randomly.
Might be worth submitting a ticket there and seeing what they say. Notifications can be very odd I find but it usually works for me very well. Do you experience the same behaviour using the example app here? example app
Hey @MichaelVerdon, Currently occupied with some other stuffs, I will open the ticket there. I have not tried using the example application but my application was a very basic flutter starter app with flutterfire dependencies.
Hey @harsh-im. 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!
Since there haven't been any recent updates here, I am going to close this issue.
@harsh-im 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.