Skip to content

Firebase Messaging is not clearing a notification tray #553

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
kroikie opened this issue Oct 13, 2019 · 9 comments
Closed

Firebase Messaging is not clearing a notification tray #553

kroikie opened this issue Oct 13, 2019 · 9 comments
Labels
blocked: customer-response Waiting for customer response, e.g. more information was requested.

Comments

@kroikie
Copy link
Collaborator

kroikie commented Oct 13, 2019

Hello,
With firebase_messaging plugin, after receiving the notification if you open the app directly, instead of tapping on the notification (in a tray), the notification will stay there.

If you tap on the notification it will clear itself.

I was hoping that there would be a method to clear a system tray notification (or it will do it automatically).

firebase_messaging: ^2.1.0

flutter doctor -v.

[✓] Flutter (Channel master, v1.0.1-pre.1, on Mac OS X 10.13.6 17G65, locale en-US)
    • Flutter version 1.0.1-pre.1 at /Users/user/flutter
    • Framework revision a226c0f0d9 (5 days ago), 2018-11-30 16:18:18 -0800
    • Engine revision 7375a0f414
    • Dart version 2.1.0 (build 2.1.0-dev.9.4 f9ebf21297)

[✓] Android toolchain - develop for Android devices (Android SDK 28.0.3)
    • Android SDK at /Users/user/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, build-tools 28.0.3
    • ANDROID_HOME = /Users/user/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_152-release-1024-b01)
    • All Android licenses accepted.

[✓] iOS toolchain - develop for iOS devices (Xcode 10.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 10.1, Build version 10B61
    • ios-deploy 1.9.4
    • CocoaPods version 1.5.3

[✓] Android Studio (version 3.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 29.0.1
    • Dart plugin version 173.4700
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)

[✓] VS Code (version 1.29.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 2.21.1

[✓] Connected device (2 available)
    • Pixel 3                   • XXXXXXXXXX     • android-arm64 • Android 9 (API 28)
    • Android SDK built for x86 • emulator-5554 • android-x86   • Android 8.1.0 (API 27) (emulator)
@kroikie
Copy link
Collaborator Author

kroikie commented Oct 13, 2019

@arsen

The issue at flutter/flutter#25030 has been closed and moved here. Future collaboration on this issue will be done here.

@iapicca
Copy link

iapicca commented Oct 22, 2019

Hi @arsen
If you are still experiencing this issue
with the latest version of Flutter and FlutterFire plugin
can you please provide your updated flutter doctor -v
and your and your flutter run --verbose/flutter build --verbose ?
Also, to better address the issue, would be helpful
if you could post a self contained app on github
or the steps to reproduce it.
Thank you

@iapicca iapicca added the blocked: customer-response Waiting for customer response, e.g. more information was requested. label Oct 22, 2019
@iapicca
Copy link

iapicca commented Nov 20, 2019

Without additional information, we are unfortunately not sure how to resolve this issue. We are therefore reluctantly going to close this bug for now. Please don't hesitate to comment on the bug if you have any more information for us; we will reopen it right away!
Thanks for your contribution.

Could everyone who still has this problem please file a new issue with the exact descriptions what happens, logs and the output of 'flutter doctor -v' please.
All system setups can be slightly different so its always better to open new issues and reference related issues.

@iapicca iapicca closed this as completed Nov 20, 2019
@mnesarco
Copy link

I have this issue too. If I open the App directly from the App icon, the notification is not received. The notification is only received and removed when taped on the system tray.

flutter doctor -v

[✓] Flutter (Channel master, v1.18.0-6.0.pre.35, on Linux, locale en_US.UTF-8)
    • Flutter version 1.18.0-6.0.pre.35 at /home/mnesarco/devel2-tools/flutter/current
    • Framework revision c97f61a452 (24 hours ago), 2020-04-15 13:12:14 -0700
    • Engine revision deef2663ac
    • Dart version 2.8.0 (build 2.8.0-dev.20.0 c9710e5059)

 
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.1)
    • Android SDK at /home/mnesarco/devel2-tools/android
    • Platform android-29, build-tools 29.0.1
    • Java binary at: /home/mnesarco/devel2-tools/ides/android-studio/jre/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)
    • All Android licenses accepted.

[✓] Android Studio (version 3.6)
    • Android Studio at /home/mnesarco/devel2-tools/ides/android-studio
    • Flutter plugin version 44.0.2
    • Dart plugin version 192.7761
    • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)

[✓] Connected device (1 available)
    • SM J610G • b45e07f9 • android-arm • Android 9 (API 28)

• No issues found!

flutter run --verbose output is massive but says nothing important, when the app is opened directly, nothing happens, onMessage, onLaunch, onResume not called and the notification is still in system tray. But if i tap the notification, everything works as expected: onResume/onLaunch called and the notification is removed.

@furkansarihan
Copy link

@mnesarco I resolved this issue on Android with adding these lines to onCreate method in MainActivity class, and on iOS should be similiar.

NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
notificationManager.cancelAll();

Import notification manager from; import android.app.NotificationManager;

@mnesarco
Copy link

@furkansarihan This is not a solution because the notification data never arrives to the app. This just eliminates the notification silently.

The expected behaviour is that if the user open the app directly, the onLaunch or onResume must be called with the data of the pending notifications.

@knissophiliac
Copy link

knissophiliac commented May 7, 2020

@furkansarihan It will lose other notifications data if we launch the app with one notification.
@iapicca I think this issue is not fixed in any way

@iapicca
Copy link

iapicca commented May 8, 2020

Could everyone who still has this problem please file a new issue with the exact descriptions what happens, logs and the output of 'flutter doctor -v' please.
All system setups can be slightly different so its always better to open new issues and reference related issues.

@knissophiliac
Copy link

knissophiliac commented May 8, 2020

I think it is wanted to have a solution to clear active notifications and get their informations.
flutter doctor -v

  ╔════════════════════════════════════════════════════════════════════════════╗
  ║ A new version of Flutter is available!                                     ║
  ║                                                                            ║
  ║ To update to the latest version, run "flutter upgrade".                    ║
  ╚════════════════════════════════════════════════════════════════════════════╝


[✓] Flutter (Channel beta, v1.15.17, on Mac OS X 10.15.4 19E266, locale tr-TR)
    • Flutter version 1.15.17 at /Users/*****/flutter
    • Framework revision 2294d75bfa (9 weeks ago), 2020-03-07 00:28:38 +0900
    • Engine revision 5aff311948
    • Dart version 2.8.0 (build 2.8.0-dev.12.0 9983424a3c)


[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    • Android SDK at /Users/bahadiraksoy/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-29, build-tools 28.0.3
    • 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.4)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.4, Build version 11E146
    • CocoaPods version 1.9.1

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

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

[✓] VS Code (version 1.45.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.10.1

[✓] Connected device (2 available)
    • Chrome     • chrome     • web-javascript • Google Chrome 81.0.4044.138
    • Web Server • web-server • web-javascript • Flutter Tools

• No issues found!

@firebase firebase locked and limited conversation to collaborators Aug 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
blocked: customer-response Waiting for customer response, e.g. more information was requested.
Projects
None yet
Development

No branches or pull requests

5 participants