You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I am using hypertrack_plugin (https://pub.dev/packages/hypertrack_plugin) which presumably uses FCM under the hood for its functioning. However using it alongside the firebase_messaging plugin, I am unable to get any message in callback onMessage() whenever the app is in the foreground. When I remove hypetrack_plugin from my project, it works fine.
Steps to reproduce
Steps to reproduce the behavior:
Add hypertrack_plugin and firebase_messaging in the project dependency.
Follow necessary steps to setup HyperTrack from the link given above.
Also, do necessary steps to setup firebase_messaging.
Implement a callback in following way:-
_firebaseMessaging.configure(
onMessage: (Map<String, dynamic> message) async {
print('on message $message');
// not called when app is in foreground when hypertrack_plugin is added to the project
},
onResume: (Map<String, dynamic> message) async {
print('on resume $message');
// called when app is launched from background state from the notification tap. This works as expected.
},
onLaunch: (Map<String, dynamic> message) async {
print('on launch $message');
// called when app is launched from terminated state from the notification tap. This works as expected.
},
);
REST API used to invoke callbacks
curl --location --request POST 'https://fcm.googleapis.com/fcm/send' \
--header 'Content-Type: application/json' \
--header 'Authorization: key=<SERVER_KEY>' \
--data-raw '{
"to": "<DEVICE_FCM_TOKEN>",
"notification": {
"title": "This is the title",
"body": "Here is the body"
},
"data": {
"click_action": "FLUTTER_NOTIFICATION_CLICK",
"title": "This is the title",
"body": "Here is the body",
"some key": "some value",
"another key": "another value"
}
}'
Expected behavior
onMessage() should be called whenever the app is in the foreground.
Additional context
Add any other context about the problem here.
Flutter doctor
Run flutter doctor and paste the output below:
Click To Expand
[✓] Flutter (Channel stable, v1.17.5, on Mac OS X 10.15.4 19E287, locale en-NP)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.1)
[✓] Xcode - develop for iOS and macOS (Xcode 11.3.1)
[✓] Android Studio (version 4.0)
[!] IntelliJ IDEA Ultimate Edition (version 2020.1.2)
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
[✓] Connected device (2 available)
! Doctor found issues in 1 category.
Flutter dependencies
Run flutter pub deps -- --style=compact and paste the output below:
When I remove hypetrack_plugin from my project, it works fine.
From what I can see, the issue is related to a 3rd party plugin rather than to firebase_messaging itself. Please open the issue in the dedicated forum
Closing, as this isn't an issue with firebase_messaging itself.
If you disagree, please write in the comments,
providing your flutter doctor -v, your flutter run -v, your pubspec.yaml
a minimal reproducible code sample that does not use 3rd party plugins,
and I will reopen it.
Thank you
Bug report
Describe the bug
I am using hypertrack_plugin (https://pub.dev/packages/hypertrack_plugin) which presumably uses FCM under the hood for its functioning. However using it alongside the firebase_messaging plugin, I am unable to get any message in callback
onMessage()
whenever the app is in the foreground. When I remove hypetrack_plugin from my project, it works fine.Steps to reproduce
Steps to reproduce the behavior:
REST API used to invoke callbacks
Expected behavior
onMessage() should be called whenever the app is in the foreground.
Additional context
Add any other context about the problem here.
Flutter doctor
Run
flutter doctor
and paste the output below:Click To Expand
Flutter dependencies
Run
flutter pub deps -- --style=compact
and paste the output below:Click To Expand
The text was updated successfully, but these errors were encountered: