Skip to content
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

[firebase_messaging] iOS isn't showing notifications on background #2987

Closed
jfrsbg opened this issue Jul 20, 2020 · 3 comments · Fixed by #4012
Closed

[firebase_messaging] iOS isn't showing notifications on background #2987

jfrsbg opened this issue Jul 20, 2020 · 3 comments · Fixed by #4012

Comments

@jfrsbg
Copy link

jfrsbg commented Jul 20, 2020

First of all, I just followed this video to configurate push notifications on android https://www.youtube.com/watch?v=9zWs0I7UpcQ. The video just follow the documentation on pub.dev, so, I just put him here to use as a reference.

I've tried many fixes here on github, there are many issues opened in the past days but none of these solved my problem. This issue will be related with many other issues but I don't know what to do anymore.

Lets talk about the problem: On Android, background notifications and foreground callbacks are working with no problems, but when I try to reproduce my code on iOS, only the "onMessage" callback is working as expected. No background messages or notifications are appearing on top of the screen.

The thing is that flutter version on the video is 1.12.13 and the version of firebase_messaging is 6.0.15 and I'm using version 6.0.16 of firebase_messaging and flutter version is 1.17.5. I just rollback the plugin version to 16.0.15 and the results are the same. I didn't try to rollback flutter version because that is not a option in the moment.

To Reproduce
follow the video or documentation and you will be ok (that means "ok" to reproduce the error)

Expected behavior
when trying to send a notification message from firebase console, with the app on background, no notification is showing on top of screen.

Flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.17.5, on Mac OS X 10.14.6 18G5033, locale en-BR)

[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 11.2.1)
[✓] Android Studio (version 3.5)

[✓] Connected device (1 available)

• No issues found!

@mintymac
Copy link

Something strange is happening with the plugin for iOS on my end as well

`[✓] Flutter (Channel stable, v1.17.5, on Mac OS X 10.15.5 19F101, locale en-US)
• Flutter version 1.17.5 at /Users/user/Downloads/flutter
• Framework revision 8af6b2f038 (3 weeks ago), 2020-06-30 12:53:55 -0700
• Engine revision ee76268252
• Dart version 2.8.4

[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
• Android SDK at /Users/user/Library/Android/sdk
• Platform android-29, build-tools 29.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_242-release-1644-b3-6222593)
• All Android licenses accepted.

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

[✓] Android Studio (version 4.0)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 47.1.2
• Dart plugin version 193.7361
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)

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

[✓] Connected device (2 available)
• Android SDK built for x86 • emulator-5554 • android-x86 • Android 10 (API 29) (emulator)
• iPhone SE (2nd generation) • C4B10CDD-0E29-4673-8CF7-6EEA7B5A9DA3 • ios • com.apple.CoreSimulator.SimRuntime.iOS-13-6 (simulator)

`

Push notifications are registering on the command line but not showDialog or AlertDialog. I would think the issue related to those, but the code seems to die only on iOS platform.

@mintymac
Copy link

@jfrsbg Have you tried simplifying the calls from the onMessage, onResume, etc callbacks. I ran into zero errors logged, but the code did contain them. The behavior was different for iOS and Android. Also, are messages printing on the console?

@TahaTesser
Copy link

I can reproduce the issue using official example

flutter doctor -v
[✓] Flutter (Channel dev, 1.21.0-1.0.pre, on Mac OS X 10.15.6 19G73, locale en-GB)
    • Flutter version 1.21.0-1.0.pre at /Users/taha/Code/flutter_dev
    • Framework revision f25bd9c55c (6 days ago), 2020-07-14 20:26:01 -0400
    • Engine revision 99c2b3a245
    • Dart version 2.9.0 (build 2.9.0-21.0.dev 20bf2fcf56)

 
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
    • Android SDK at /Users/taha/Code/sdk
    • Platform android-29, build-tools 29.0.3
    • ANDROID_HOME = /Users/taha/Code/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
    • All Android licenses accepted.

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

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

[✓] Android Studio (version 4.0)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 47.1.2
    • Dart plugin version 193.7361
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)

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

[✓] Connected device (5 available)
    • SM M305F (mobile)      • 32003c30dc19668f          • android-arm64  • Android 10 (API 29)
    • Taha’s iPhone (mobile) • 00008020-001059882212002E • ios            • iOS 13.6
    • macOS (desktop)        • macos                     • darwin-x64     • Mac OS X 10.15.6 19G73
    • Web Server (web)       • web-server                • web-javascript • Flutter Tools
    • Chrome (web)           • chrome                    • web-javascript • Google Chrome 84.0.4147.89

• No issues found!

Closing as duplicate of #2854

@firebase firebase locked and limited conversation to collaborators Aug 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants