flutterfire icon indicating copy to clipboard operation
flutterfire copied to clipboard

[Flutter firebase cloud messaging] - Android duplicate notifications

Open sergitovar91 opened this issue 6 years ago • 1 comments

I just created a new flutter project (the default project) I have followed all the step to use firebase cloud messaging library in flutter (https://pub.dev/packages/firebase_messaging) and I receive duplicate notifications only in android (ios is working fine)

Steps to reproduce the behavior:

  1. Create the default flutter project
  2. Add firebase cloud messaging library and listeners following this url https://pub.dev/packages/firebase_messaging
  3. Run the app in android

Expected behavior Only one notification

Additional context [✓] Flutter (Channel master, v1.14.2-pre.51, on Mac OS X 10.15.2 19C57, locale en-ES) • Flutter version 1.14.2-pre.51 at • Framework revision ec1044a877 (3 days ago), 2020-01-17 19:19:33 -0800 • Engine revision ecc74c966d • Dart version 2.8.0 (build 2.8.0-dev.3.0 f96c48307d)

[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2) • Android SDK at /Users/sergio/Library/Android/sdk • Android NDK location not configured (optional; useful for native profiling support) • Platform android-29, build-tools 29.0.2 • ANDROID_HOME = /Users/sergio/Library/Android/sdk • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405) • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 11.3.1) • Xcode at /Applications/Xcode.app/Contents/Developer • Xcode 11.3.1, Build version 11C504 • CocoaPods version 1.7.5

[✓] Android Studio (version 3.5) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin version 42.1.1 • Dart plugin version 191.8593 • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)

[✓] Connected device (1 available) • Android SDK built for x86 • emulator-5554 • android-x86 • Android 10 (API 29) (emulator)

OUTPUT Note: /Users/sergio/.pub-cache/hosted/pub.dartlang.org/firebase_messaging-6.0.9/android/src/main/java/io/flutter/plugins/firebasemessaging/FirebaseMessagingPlugin.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. W/FirebaseMessaging( 5781): Unable to log event: analytics library is missing W/FirebaseMessaging( 5781): Unable to log event: analytics library is missing I/flutter ( 5781): onMessage: {notification: {title: prueba, body: prueba}, data: {}} I/flutter ( 5781): onMessage: {notification: {title: prueba, body: prueba}, data: {}}

Someone can help me with this ? I have been using this library and I didn't receive this bug but now it is working with the easiest project what we can do and it is not working fine.

CODE code.txt

sergitovar91 avatar Jan 20 '20 19:01 sergitovar91

Hi @sergitovar91 I see there's an open issue addressing the case you described. Please follow up on that issue, I'm closing the current one as duplicate. If you disagree please write in the comments and I will reopen it. Thank you

iapicca avatar Jan 21 '20 10:01 iapicca