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] onResume called when app in backgroun -for iOS only #4003

Closed
maciogg opened this issue Oct 31, 2020 · 1 comment · Fixed by #4012
Closed

🐛 [firebase_messaging] onResume called when app in backgroun -for iOS only #4003

maciogg opened this issue Oct 31, 2020 · 1 comment · Fixed by #4012
Labels
blocked: customer-response Waiting for customer response, e.g. more information was requested. type: bug Something isn't working

Comments

@maciogg
Copy link

maciogg commented Oct 31, 2020

Bug report

onResume is called when app is in backgroun mode - it is for iOS only
When app go to foreground mode onResume is calling again

Steps to reproduce

Steps to reproduce the behavior:

  1. Push notification is send
  2. Notification is shown on device
  3. onResume is called (only on iOS - Android is as expected - no onResume)
  4. notification tapped
  5. app going to foreground
  6. onResume is called again

Expected behavior

No onResume called when app is on background mode


Additional context

Add any other context about the problem here.


Flutter doctor

Click To Expand

[✓] Flutter (Channel master, 1.23.0-8.0.pre.51, on Mac OS X 10.15.7 19H2 x86_64, locale pl-PL)

[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
[✓] Xcode - develop for iOS and macOS (Xcode 12.1)
[✓] Android Studio (version 4.0)
[✓] VS Code (version 1.50.1)
[✓] Connected device (1 available)

• No issues found!
maciej.geciow@MacBook-Pro moja_plytoteka % run flutter doctor -v
zsh: command not found: run
maciej.geciow@MacBook-Pro moja_plytoteka % flutter doctor -v
[✓] Flutter (Channel master, 1.23.0-8.0.pre.51, on Mac OS X 10.15.7 19H2 x86_64, locale pl-PL)
• Flutter version 1.23.0-8.0.pre.51 at /Users/maciej.geciow/Development/flutter
• Framework revision d693d2b9d2 (5 weeks ago), 2020-09-29 09:29:36 -0700
• Engine revision 414805d1d8
• Dart version 2.11.0 (build 2.11.0-176.0.dev)

[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
• Android SDK at /Users/maciej.geciow/Library/Android/sdk
• Platform android-30, build-tools 29.0.2
• 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 12.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 12.1, Build version 12A7403
• CocoaPods version 1.9.1

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

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

[✓] Connected device (1 available)
• AMN LX9 (mobile) • WNPNU20110303518 • android-arm • Android 9 (API 28)

• No issues found!


Flutter dependencies

Click To Expand

Dart SDK 2.11.0-176.0.dev
Flutter SDK 1.23.0-8.0.pre.51
moja_plytoteka 1.1.0+2
|-- about 1.2.0
| |-- flutter...
| |-- flutter_markdown 0.4.4
| | |-- flutter...
| | |-- markdown...
| | |-- meta...
| | '-- path...
| |-- markdown 2.1.8
| | |-- args...
| | |-- charcode...
| | '-- meta...
| |-- package_info...
| |-- path 1.8.0-nullsafety.1
| |-- pedantic 1.9.2
| | '-- meta...
| |-- simple_mustache 1.0.0
| | '-- meta...
| '-- url_launcher...
|-- audioplayers 0.16.2
| |-- flutter...
| |-- flutter_web_plugins...
| |-- path_provider...
| '-- uuid 2.2.2
| |-- convert...
| '-- crypto...
|-- circular_menu 1.1.0
| '-- flutter...
|-- connectivity 0.4.9+5
| |-- connectivity_for_web 0.3.1+2
| | |-- connectivity_platform_interface...
| | |-- flutter...
| | '-- flutter_web_plugins...
| |-- connectivity_macos 0.1.0+5
| | '-- flutter...
| |-- connectivity_platform_interface 1.0.6
| | |-- flutter...
| | |-- meta...
| | '-- plugin_platform_interface...
| |-- flutter...
| '-- meta...
|-- crypto 2.1.5
| |-- collection...
| |-- convert 2.1.1
| | |-- charcode...
| | '-- typed_data...
| '-- typed_data...
|-- cupertino_icons 0.1.3
|-- device_info 0.4.2+8
| |-- device_info_platform_interface 1.0.1
| | |-- flutter...
| | |-- meta...
| | '-- plugin_platform_interface...
| '-- flutter...
|-- dio 3.0.10
| |-- http_parser...
| '-- path...
|-- email_validator 1.0.5
|-- equatable 1.2.5
| |-- collection...
| '-- meta...
|-- filesize 1.0.4
|-- firebase_messaging 7.0.3
| |-- firebase_core 0.5.1
| | |-- firebase_core_platform_interface 2.0.0
| | | |-- flutter...
| | | |-- meta...
| | | |-- plugin_platform_interface...
| | | '-- quiver...
| | |-- firebase_core_web 0.2.0
| | | |-- firebase 7.3.2
| | | | |-- http...
| | | | |-- http_parser...
| | | | '-- js...
| | | |-- firebase_core_platform_interface...
| | | |-- flutter...
| | | |-- flutter_web_plugins...
| | | |-- js 0.6.2
| | | '-- meta...
| | |-- flutter...
| | |-- meta...
| | '-- quiver 2.1.4+1
| | |-- matcher...
| | '-- meta...
| |-- flutter...
| '-- meta...
|-- flutter 0.0.0
| |-- characters 1.1.0-nullsafety.3
| |-- collection 1.15.0-nullsafety.3
| |-- meta 1.3.0-nullsafety.3
| |-- sky_engine 0.0.99
| |-- typed_data 1.3.0-nullsafety.3
| | '-- collection...
| '-- vector_math 2.1.0-nullsafety.3
|-- flutter_launcher_icons 0.8.0
| |-- args 1.6.0
| |-- image 2.1.18
| | |-- archive 2.0.13
| | | |-- args...
| | | |-- crypto...
| | | '-- path...
| | |-- meta...
| | '-- xml 4.5.1
| | |-- collection...
| | |-- convert...
| | |-- meta...
| | '-- petitparser 3.1.0
| | '-- meta...
| '-- yaml 2.2.1
| |-- charcode...
| |-- collection...
| |-- source_span...
| '-- string_scanner...
|-- flutter_test 0.0.0
| |-- async 2.5.0-nullsafety.1
| | '-- collection...
| |-- boolean_selector 2.1.0-nullsafety.1
| | |-- source_span...
| | '-- string_scanner...
| |-- characters...
| |-- charcode 1.2.0-nullsafety.1
| |-- clock 1.1.0-nullsafety.1
| |-- collection...
| |-- fake_async 1.2.0-nullsafety.1
| | |-- clock...
| | '-- collection...
| |-- flutter...
| |-- matcher 0.12.10-nullsafety.1
| | '-- stack_trace...
| |-- meta...
| |-- path...
| |-- source_span 1.8.0-nullsafety.2
| | |-- charcode...
| | |-- collection...
| | |-- path...
| | '-- term_glyph...
| |-- stack_trace 1.10.0-nullsafety.1
| | '-- path...
| |-- stream_channel 2.1.0-nullsafety.1
| | '-- async...
| |-- string_scanner 1.1.0-nullsafety.1
| | |-- charcode...
| | '-- source_span...
| |-- term_glyph 1.2.0-nullsafety.1
| |-- test_api 0.2.19-nullsafety.2
| | |-- async...
| | |-- boolean_selector...
| | |-- collection...
| | |-- matcher...
| | |-- meta...
| | |-- path...
| | |-- source_span...
| | |-- stack_trace...
| | |-- stream_channel...
| | |-- string_scanner...
| | '-- term_glyph...
| |-- typed_data...
| '-- vector_math...
|-- font_awesome_flutter 8.10.0
| '-- flutter...
|-- hexcolor 1.0.6
| |-- flutter...
| '-- flutter_web_plugins 0.0.0
| |-- characters...
| |-- collection...
| |-- flutter...
| |-- meta...
| |-- typed_data...
| '-- vector_math...
|-- http 0.12.2
| |-- http_parser 3.1.4
| | |-- charcode...
| | |-- collection...
| | |-- source_span...
| | |-- string_scanner...
| | '-- typed_data...
| |-- path...
| '-- pedantic...
|-- intl 0.16.1
| '-- path...
|-- ios_utsname_ext 1.0.0
| '-- flutter...
|-- network_to_file_image 2.3.6
| '-- flutter...
|-- package_info 0.4.3
| '-- flutter...
|-- page_transition 1.1.6
| '-- flutter...
|-- path_provider 1.6.22
| |-- flutter...
| |-- path_provider_linux 0.0.1+2
| | |-- flutter...
| | |-- path...
| | |-- path_provider_platform_interface...
| | '-- xdg_directories 0.1.2
| | |-- meta...
| | |-- path...
| | '-- process 3.0.13
| | |-- file...
| | |-- intl...
| | |-- meta...
| | |-- path...
| | '-- platform...
| |-- path_provider_macos 0.0.4+4
| | '-- flutter...
| |-- path_provider_platform_interface 1.0.3
| | |-- flutter...
| | |-- meta...
| | |-- platform 2.2.1
| | '-- plugin_platform_interface 1.0.2
| | '-- meta...
| '-- path_provider_windows 0.0.4+1
| |-- ffi...
| |-- flutter...
| |-- meta...
| |-- path...
| |-- path_provider_platform_interface...
| '-- win32 1.7.3
| '-- ffi...
|-- percent_indicator 2.1.7+4
| '-- flutter...
|-- rflutter_alert 1.1.0
| '-- flutter...
|-- shared_preferences 0.5.12
| |-- flutter...
| |-- meta...
| |-- shared_preferences_linux 0.0.2+2
| | |-- file 5.2.1
| | | |-- intl...
| | | |-- meta...
| | | '-- path...
| | |-- flutter...
| | |-- meta...
| | |-- path...
| | |-- path_provider_linux...
| | '-- shared_preferences_platform_interface...
| |-- shared_preferences_macos 0.0.1+10
| | |-- flutter...
| | '-- shared_preferences_platform_interface...
| |-- shared_preferences_platform_interface 1.0.4
| | |-- flutter...
| | '-- meta...
| |-- shared_preferences_web 0.1.2+7
| | |-- flutter...
| | |-- flutter_web_plugins...
| | |-- meta...
| | '-- shared_preferences_platform_interface...
| '-- shared_preferences_windows 0.0.1+1
| |-- ffi 0.1.3
| |-- file...
| |-- flutter...
| |-- meta...
| |-- path...
| |-- path_provider_platform_interface...
| |-- path_provider_windows...
| '-- shared_preferences_platform_interface...
|-- url_launcher 5.7.2
| |-- flutter...
| |-- url_launcher_linux 0.0.1+1
| | '-- flutter...
| |-- url_launcher_macos 0.0.1+8
| | '-- flutter...
| |-- url_launcher_platform_interface 1.0.8
| | |-- flutter...
| | |-- meta...
| | '-- plugin_platform_interface...
| |-- url_launcher_web 0.1.4+1
| | |-- flutter...
| | |-- flutter_web_plugins...
| | |-- meta...
| | '-- url_launcher_platform_interface...
| '-- url_launcher_windows 0.0.1+1
| '-- flutter...
'-- webview_flutter 1.0.3
'-- flutter...


@maciogg maciogg added Needs Attention This issue needs maintainer attention. type: bug Something isn't working labels Oct 31, 2020
@TahaTesser
Copy link

TahaTesser commented Nov 3, 2020

Hi @maciogg
Just tried on ios on the latest stable plugins as seen your plugins logs

[+20991 ms] flutter: onResume: {id: 1, google.c.a.c_id: 9212739073003242153, gcm.n.e: 1, google.c.a.e: 1, gcm.message_id:
1604409599880144, google.c.sender.id: 486685679562, gcm.notification.sound2: default, google.c.a.udt: 0, google.c.a.ts:
1604409599, aps: {mutable-content: 1, alert: {title: Test, body: This is a test}, badge: 1, sound: default}, click_action:
FLUTTER_NOTIFICATION_CLICK, status: done}

onResume is only called when you tap on the notification and never got called when in background on the latest stable flutter channel

flutter doctor -v
[✓] Flutter (Channel stable, 1.22.3, on Mac OS X 10.15.7 19H2, locale en-GB)
    • Flutter version 1.22.3 at /Users/tahatesser/Code/flutter_stable
    • Framework revision 8874f21e79 (5 days ago), 2020-10-29 14:14:35 -0700
    • Engine revision a1440ca392
    • Dart version 2.10.3

 
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
    • Android SDK at /Users/tahatesser/Code/sdk
    • Platform android-30, build-tools 30.0.2
    • ANDROID_HOME = /Users/tahatesser/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 12.1)
    • Xcode at /Volumes/Extreme/Xcode.app/Contents/Developer
    • Xcode 12.1, Build version 12A7403
    • CocoaPods version 1.10.0

[!] Android Studio (version 4.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
    • Java version OpenJDK Runtime Environment (build
      1.8.0_242-release-1644-b3-6222593)

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

[✓] Connected device (1 available)
    • Taha’s iPhone (mobile) • 00008020-001059882212002E • ios • iOS 14.1
    ! Error: Taha’s iPhone is busy: Copying cache files from device. Xcode will
      continue when Taha’s iPhone is finished. (code -10)

! Doctor found issues in 1 category.

Can you please reproduce this issue consistently?

@TahaTesser TahaTesser added blocked: customer-response Waiting for customer response, e.g. more information was requested. and removed Needs Attention This issue needs maintainer attention. labels Nov 3, 2020
@firebase firebase locked and limited conversation to collaborators Dec 4, 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. type: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants