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] In terminated state on iOS main is called instead of onBackgroundMessage #7407

Open
vishnukvmd opened this issue Nov 22, 2021 · 31 comments
Assignees
Labels
platform: ios Issues / PRs which are specifically for iOS. plugin: messaging type: bug Something isn't working type: documentation Improvements or additions to documentation

Comments

@vishnukvmd
Copy link

Bug report

Describe the bug

On iOS, registering a top-level function with FirebaseMessaging.onBackgroundMessage does not guarantee that it will get invoked when a data-only push (without a notification payload) is received when the app is dead.

Instead, the top-level main function is called without the RemoteMessage object.

Steps to reproduce

Steps to reproduce the behavior:

  1. Create an app that registers a BackgroundMessageHandler with FirebaseMessaaging.onBackgroundMessage that simply logs the incoming RemoteMessage to a file.
  2. Write a server that will periodically send a ContentAvailable push to this device.
  3. Also add a log-line to main that logs it's invocation to the same file.
  4. View the logs to verify that the BackgroundMessageHandler is never called when the app is dead.

After 24 hours if you check the log file, you will observe that as long as the app is alive the BackgroundMessageHandler will be called, and otherwise the main function will be called.

Expected behavior

BackgroundMessageHandler should always be called.


Additional context

On iOS, it is important to not do heavy operations when the app is in the background. Since the main function is now being invoked on background pushes, there is no way for application developers to understand if the app was started by the user or by a background push. If there is some other way to determine this, please let me know, we would be grateful.


Flutter doctor

Run flutter doctor and paste the output below:

Click To Expand
$ flutter doctor
[✓] Flutter (Channel stable, 2.5.2, on macOS 11.3.1 20E241 darwin-arm, locale en-IN)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[✓] Xcode - develop for iOS and macOS
[✓] Chrome - develop for the web
[!] Android Studio (not installed)
[✓] IntelliJ IDEA Ultimate Edition (version 2021.2)
[✓] VS Code (version 1.62.2)
[✓] Connected device (3 available)
! Doctor found issues in 1 category.

Flutter dependencies

Run flutter pub deps -- --style=compact and paste the output below:

Click To Expand
✗ flutter pub deps -- --style=compact
Dart SDK 2.14.3
Flutter SDK 2.5.2
photos 0.3.48+258

dependencies:
- alice 0.2.4 [flutter http dio flutter_local_notifications rxdart path_provider permission_handler package_info_plus open_file sensors share chopper better_player collection]
- animate_do 2.0.0 [flutter]
- archive 3.1.2 [crypto path]
- background_fetch 1.0.1 [flutter]
- bip39 1.0.6 [pointycastle hex crypto]
- cached_network_image 3.0.0 [flutter flutter_cache_manager octo_image]
- chewie 1.2.2 [cupertino_icons flutter provider video_player wakelock]
- computer 2.0.0 [meta]
- confetti 0.6.0 [flutter vector_math]
- connectivity 3.0.6 [flutter meta connectivity_platform_interface connectivity_macos connectivity_for_web]
- crisp 0.1.6 [flutter url_launcher flutter_inappwebview]
- cupertino_icons 1.0.3
- device_info 2.0.2 [flutter device_info_platform_interface]
- dio 4.0.0 [http_parser path]
- dots_indicator 2.0.0 [flutter]
- email_validator 2.0.1
- event_bus 2.0.0
- exif 3.0.0 [args collection convert sprintf]
- expansion_tile_card 2.0.0 [flutter]
- extended_image 5.1.2 [extended_image_library flutter meta]
- firebase_core 1.7.0 [firebase_core_platform_interface firebase_core_web flutter meta]
- firebase_messaging 10.0.8 [firebase_core firebase_core_platform_interface firebase_messaging_platform_interface firebase_messaging_web flutter meta]
- fk_user_agent 2.0.1 [flutter]
- flutter 0.0.0 [characters collection meta typed_data vector_math sky_engine]
- flutter_cache_manager 3.1.0 [clock collection file flutter http image path path_provider pedantic rxdart sqflite uuid]
- flutter_datetime_picker 1.5.1 [flutter]
- flutter_easyloading 3.0.0 [flutter flutter_spinkit]
- flutter_email_sender 5.0.2 [flutter]
- flutter_image_compress 1.1.0 [flutter]
- flutter_inappwebview 5.3.2 [flutter]
- flutter_local_notifications 8.2.0 [flutter flutter_local_notifications_platform_interface platform timezone]
- flutter_localizations 0.0.0 [flutter intl characters clock collection meta path typed_data vector_math]
- flutter_password_strength 0.1.6 [flutter]
- flutter_secure_storage 4.2.0 [meta flutter]
- flutter_sodium 0.2.0 [flutter ffi]
- flutter_typeahead 3.2.1 [flutter flutter_keyboard_visibility]
- flutter_windowmanager 0.2.0 [flutter]
- fluttercontactpicker 4.4.0 [flutter contact_picker_platform_interface contact_picker_web]
- fluttertoast 8.0.7 [flutter flutter_web_plugins]
- google_nav_bar 5.0.5 [flutter]
- image 3.0.2 [archive meta xml]
- image_editor 1.0.1 [flutter]
- implicitly_animated_reorderable_list 0.4.0 [flutter async meta]
- in_app_purchase 0.5.2 [flutter json_annotation meta collection]
- intl 0.17.0 [clock path]
- like_button 2.0.2 [flutter]
- loading_animations 2.2.0 [flutter]
- local_auth 1.1.6 [flutter flutter_plugin_android_lifecycle intl meta platform]
- logging 1.0.1
- motionphoto 0.0.1 [flutter]
- move_to_background 1.0.2 [flutter]
- open_file 3.2.1 [flutter ffi]
- package_info_plus 1.3.0 [flutter package_info_plus_platform_interface package_info_plus_linux package_info_plus_macos package_info_plus_windows package_info_plus_web]
- page_transition 2.0.2 [flutter]
- path_provider 2.0.2 [flutter path_provider_platform_interface path_provider_macos path_provider_linux path_provider_windows]
- pedantic 1.11.1
- photo_manager 1.3.6 [flutter]
- photo_view 0.12.0 [flutter]
- pie_chart 5.0.0 [flutter]
- pinput 1.2.2 [flutter]
- provider 6.0.1 [collection flutter nested]
- quiver 3.0.1 [matcher]
- receive_sharing_intent 1.4.5 [flutter]
- scrollable_positioned_list 0.2.2 [flutter collection]
- sentry 5.1.0 [http meta stack_trace uuid]
- share_plus 2.2.0 [meta mime flutter share_plus_platform_interface share_plus_linux share_plus_macos share_plus_windows share_plus_web]
- shared_preferences 2.0.6 [meta flutter shared_preferences_platform_interface shared_preferences_linux shared_preferences_macos shared_preferences_web shared_preferences_windows]
- sqflite 2.0.0+3 [flutter sqflite_common path]
- sqflite_migration 0.3.0 [flutter sqflite]
- super_logging 1.3.4 [flutter package_info_plus device_info logging intl path path_provider sentry_flutter]
- syncfusion_flutter_core 19.2.49 [vector_math flutter]
- syncfusion_flutter_sliders 19.2.49 [flutter intl syncfusion_flutter_core]
- uni_links 0.5.1 [flutter uni_links_platform_interface uni_links_web]
- url_launcher 6.0.4 [flutter url_launcher_platform_interface url_launcher_linux url_launcher_macos url_launcher_windows url_launcher_web]
- uuid 3.0.4 [crypto]
- video_player 2.2.5 [flutter meta video_player_platform_interface video_player_web html]
- video_thumbnail 0.4.3 [flutter]
- visibility_detector 0.2.0 [flutter]
- wallpaper_manager_flutter 0.0.2 [flutter]

dev dependencies:
- flutter_launcher_icons 0.9.0 [args image path yaml]
- flutter_native_splash 1.1.8+4 [image meta path xml yaml universal_io]
- flutter_test 0.0.0 [flutter test_api path fake_async clock stack_trace vector_math async boolean_selector characters charcode collection matcher meta source_span stream_channel string_scanner term_glyph typed_data]
- lints 1.0.1

dependency overrides:
- flutter_local_notifications 8.2.0 [flutter flutter_local_notifications_platform_interface platform timezone]
- provider 6.0.1 [collection flutter nested]

transitive dependencies:
- args 2.0.0
- async 2.8.1 [collection meta]
- better_player 0.0.73 [flutter cupertino_icons wakelock pedantic meta flutter_widget_from_html_core visibility_detector path_provider collection xml]
- boolean_selector 2.1.0 [source_span string_scanner]
- characters 1.1.0
- charcode 1.3.1
- chopper 4.0.1 [http meta logging]
- clock 1.1.0
- collection 1.15.0
- connectivity_for_web 0.4.0 [connectivity_platform_interface flutter_web_plugins flutter]
- connectivity_macos 0.2.0 [flutter]
- connectivity_platform_interface 2.0.1 [flutter meta plugin_platform_interface]
- contact_picker_platform_interface 4.4.0 [flutter meta plugin_platform_interface]
- contact_picker_web 4.4.0 [flutter flutter_web_plugins js contact_picker_platform_interface]
- convert 3.0.1 [typed_data]
- crypto 3.0.1 [collection typed_data]
- csslib 0.17.1 [source_span]
- device_info_platform_interface 2.0.1 [flutter meta plugin_platform_interface]
- extended_image_library 3.1.0 [crypto flutter http_client_helper path path_provider]
- fake_async 1.2.0 [clock collection]
- ffi 1.1.1
- file 6.1.1 [meta path]
- firebase_core_platform_interface 4.0.1 [collection flutter meta plugin_platform_interface]
- firebase_core_web 1.1.0 [firebase_core_platform_interface flutter flutter_web_plugins js meta]
- firebase_messaging_platform_interface 3.0.6 [firebase_core flutter meta plugin_platform_interface]
- firebase_messaging_web 2.0.6 [firebase_core firebase_core_web firebase_messaging_platform_interface flutter flutter_web_plugins js meta]
- flutter_blurhash 0.6.0 [flutter meta pedantic]
- flutter_keyboard_visibility 5.0.3 [meta flutter_keyboard_visibility_platform_interface flutter_keyboard_visibility_web flutter]
- flutter_keyboard_visibility_platform_interface 2.0.0 [flutter meta plugin_platform_interface]
- flutter_keyboard_visibility_web 2.0.0 [flutter_keyboard_visibility_platform_interface flutter_web_plugins flutter]
- flutter_local_notifications_platform_interface 4.0.1 [flutter plugin_platform_interface]
- flutter_plugin_android_lifecycle 2.0.2 [flutter]
- flutter_spinkit 5.0.0 [flutter]
- flutter_web_plugins 0.0.0 [flutter js characters collection meta typed_data vector_math]
- flutter_widget_from_html_core 0.6.2 [csslib flutter html]
- hex 0.2.0
- html 0.15.0 [csslib source_span]
- http 0.13.3 [async http_parser meta path pedantic]
- http_client_helper 2.0.2 [http]
- http_parser 4.0.0 [charcode collection source_span string_scanner typed_data]
- js 0.6.3
- json_annotation 4.1.0 [meta]
- matcher 0.12.10 [stack_trace]
- meta 1.7.0
- mime 1.0.0
- nested 1.0.0 [flutter]
- octo_image 1.0.0+1 [flutter flutter_blurhash]
- package_info_plus_linux 1.0.3 [package_info_plus_platform_interface flutter path]
- package_info_plus_macos 1.2.0 [flutter]
- package_info_plus_platform_interface 1.0.2 [flutter meta plugin_platform_interface]
- package_info_plus_web 1.0.4 [flutter flutter_web_plugins http meta package_info_plus_platform_interface]
- package_info_plus_windows 1.0.4 [package_info_plus_platform_interface ffi flutter win32]
- path 1.8.0
- path_provider_linux 2.0.0 [path xdg_directories path_provider_platform_interface flutter]
- path_provider_macos 2.0.0 [flutter]
- path_provider_platform_interface 2.0.1 [flutter meta platform plugin_platform_interface]
- path_provider_windows 2.0.1 [path_provider_platform_interface meta path flutter ffi win32]
- permission_handler 8.2.2 [flutter meta permission_handler_platform_interface]
- permission_handler_platform_interface 3.7.0 [flutter meta plugin_platform_interface]
- petitparser 4.3.0 [meta]
- platform 3.0.0
- plugin_platform_interface 2.0.0 [meta]
- pointycastle 3.4.0 [collection convert js]
- process 4.2.1 [file path platform]
- rxdart 0.27.2
- sensors 2.0.3 [flutter]
- sentry_flutter 5.1.0 [flutter flutter_web_plugins sentry package_info_plus]
- share 2.0.4 [meta mime flutter]
- share_plus_linux 2.0.4 [share_plus_platform_interface file flutter meta url_launcher]
- share_plus_macos 2.0.2 [share_plus_platform_interface flutter]
- share_plus_platform_interface 2.0.1 [flutter meta mime plugin_platform_interface]
- share_plus_web 2.0.4 [share_plus_platform_interface url_launcher flutter flutter_web_plugins meta]
- share_plus_windows 2.0.3 [share_plus_platform_interface flutter meta url_launcher]
- shared_preferences_linux 2.0.0 [flutter file meta path path_provider_linux shared_preferences_platform_interface]
- shared_preferences_macos 2.0.0 [shared_preferences_platform_interface flutter]
- shared_preferences_platform_interface 2.0.0 [flutter]
- shared_preferences_web 2.0.0 [shared_preferences_platform_interface flutter flutter_web_plugins meta]
- shared_preferences_windows 2.0.0 [shared_preferences_platform_interface flutter file meta path path_provider_platform_interface path_provider_windows]
- sky_engine 0.0.99
- source_span 1.8.1 [collection path term_glyph]
- sprintf 6.0.0
- sqflite_common 2.0.0+2 [synchronized path meta]
- stack_trace 1.10.0 [path]
- stream_channel 2.1.0 [async]
- string_scanner 1.1.0 [charcode source_span]
- synchronized 3.0.0
- term_glyph 1.2.0
- test_api 0.4.2 [async boolean_selector collection meta source_span stack_trace stream_channel string_scanner term_glyph matcher]
- timezone 0.8.0 [path]
- typed_data 1.3.0 [collection]
- uni_links_platform_interface 1.0.0 [flutter plugin_platform_interface]
- uni_links_web 0.1.0 [flutter flutter_web_plugins uni_links_platform_interface]
- universal_io 2.0.4 [collection crypto meta typed_data]
- url_launcher_linux 2.0.0 [flutter]
- url_launcher_macos 2.0.0 [flutter]
- url_launcher_platform_interface 2.0.3 [flutter plugin_platform_interface]
- url_launcher_web 2.0.0 [url_launcher_platform_interface meta flutter flutter_web_plugins]
- url_launcher_windows 2.0.0 [flutter]
- vector_math 2.1.0
- video_player_platform_interface 4.2.0 [flutter flutter_test meta]
- video_player_web 2.0.4 [flutter flutter_web_plugins meta video_player_platform_interface]
- wakelock 0.5.6 [flutter meta wakelock_macos wakelock_platform_interface wakelock_web wakelock_windows]
- wakelock_macos 0.4.0 [flutter flutter_web_plugins wakelock_platform_interface]
- wakelock_platform_interface 0.3.0 [flutter meta]
- wakelock_web 0.4.0 [flutter flutter_web_plugins js wakelock_platform_interface]
- wakelock_windows 0.2.0 [flutter wakelock_platform_interface win32]
- win32 2.0.5 [ffi]
- xdg_directories 0.2.0 [meta path process]
- xml 5.3.0 [collection meta petitparser]
- yaml 3.1.0 [collection source_span string_scanner]

@vishnukvmd vishnukvmd added Needs Attention This issue needs maintainer attention. type: bug Something isn't working labels Nov 22, 2021
@vishnukvmd vishnukvmd changed the title 🐛 [firebase_messaging] [iOS] main() is being called instead of BackgroundMessageHandler 🐛 [firebase_messaging] In terminated state on iOS main is called instead of onBackgroundMessage Nov 24, 2021
@darshankawar darshankawar added the triage Issue is currently being triaged. label Nov 29, 2021
@darshankawar
Copy link

@vishnukvmd
How are you terminating the app ? Is it by swiping away from recent screens ? If so, in that case we need to manually re-open the app again for messages to start working. Can you try the same and see if this aspect helps ?

@darshankawar darshankawar 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 29, 2021
@vishnukvmd
Copy link
Author

Hey @darshankawar , I've already made sure that the app is never manually terminated.

@google-oss-bot google-oss-bot added Needs Attention This issue needs maintainer attention. and removed blocked: customer-response Waiting for customer response, e.g. more information was requested. labels Nov 29, 2021
@darshankawar
Copy link

@vishnukvmd
Thanks for the update. Is there a simpler way to replicate this issue to analyze where the issue could be along with a sample data only payload ?

@darshankawar darshankawar 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 30, 2021
@vishnukvmd
Copy link
Author

@darshankawar Since a server/script is required to send out an intermittent push, an example that includes the service would be non-trivial.

This is reproducible behavior for all pushes with a data-only message that looks like this:

message := &messaging.MulticastMessage{
	Tokens:  tokens,
	Data:    map[string]string{"action": "sync"},
	APNS:  &messaging.APNSConfig{
		Headers: map[string]string{
			"apns-push-type": "background",
			"apns-priority":  "5",             // Must be `5` when `contentAvailable` is set to true.
			"apns-topic":     "io.ente.frame", // bundle identifier
		},
		Payload: &messaging.APNSPayload{Aps: &messaging.Aps{ContentAvailable: true}},
	},
}

The message results in an app startup 100% of the times, so there are no delivery issues.

The problem here is that there's no way to identify if the app was started in the foreground, or if it was started as a result of a background push.

@google-oss-bot google-oss-bot added Needs Attention This issue needs maintainer attention. and removed blocked: customer-response Waiting for customer response, e.g. more information was requested. labels Nov 30, 2021
@darshankawar
Copy link

darshankawar commented Dec 1, 2021

Keeping it open for further insights from the team on correct / expected behavior in this case.

@darshankawar darshankawar added plugin: messaging platform: ios Issues / PRs which are specifically for iOS. type: documentation Improvements or additions to documentation and removed Needs Attention This issue needs maintainer attention. triage Issue is currently being triaged. type: bug Something isn't working labels Dec 1, 2021
@darshankawar darshankawar added the type: bug Something isn't working label Sep 12, 2022
@raphire08
Copy link

Any update on this issue? We are also facing this issue. The main flutter application starts running in the background and it is causing the side-effects.

The expected behaviour should be to execute only the high level function mentioned in FirebaseMessaging.onBackgroundMessage.

We noticed that on background application launch, the execution gets stopped if any Screen navigation code is present like Navigator.pushReplacementNamed(context, AppRoutes.loginScreen)

So one workaround we found was to launch the application in dummy screen and automatically shift to FirstScreen/HomeScreen after 0.1 seconds of delay. We need to remove the screen navigation animation in this case. Now if user opens the application it is working, user would not notice the dummy screen and when application is launched in background because of data-only notification, the main app execution is stopped but the high level function is still working.
In our case the high level function is inside a separate isolate.

@AyonAB
Copy link

AyonAB commented Nov 8, 2022

Hi, do we have any update on this issue?

@Lyokone Lyokone self-assigned this Jan 2, 2023
@adar2378
Copy link

adar2378 commented Mar 6, 2023

Not sure if this is relevant. In the react-native plugin, it mentions that the app would get mounted from the background handler. There is some headless check.

https://rnfirebase.io/messaging/usage#background-application-state

@adar2378
Copy link

adar2378 commented Mar 9, 2023

@darshankawar Any update on this issue?

@adar2378
Copy link

adar2378 commented Mar 9, 2023

@raphire08 Can you please share a few details on how did you solve the main method execution? Your help will be much appreciated, thanks.

@adar2378
Copy link

adar2378 commented Mar 9, 2023

@Lyokone Were you able to test it?

Actually it is reproducible in the example app as well.

  • Check if you have set onBackgroundMessage callback.
  • Add a print statement at the start of the main method.
  • Then then in iOS terminated state, send a data-only message, when the message comes,
    you will see the print statement in main method gets called. We are having quite a difficult time due to this bug.

@Lyokone
Copy link
Contributor

Lyokone commented Mar 9, 2023

Hey @adar2378
It seems related to how Flutter is handling waking up the dart Isolate. It keeps firing up the main even thought this is just handling the background notification.
Not sure if it can be solved from the FlutterFire side for now.

@adar2378
Copy link

adar2378 commented Mar 9, 2023

@Lyokone Is there any way to detect if the it was triggered(calling main method) by background isolate, or a normal user is opening the app?
Or any issues on Flutter GH that you know is tracking this issue?

@flagamail
Copy link

This bug holds back the feature to show user action when app is terminated as the onBackgroundMessage callback is not called?

@raphire08
Copy link

@adar2378
We implemented something like this

void main() {
  // fireabase initialization
  // firebase messaging on background call
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const DummyScreen(),
    );
  }
}

class DummyScreen extends StatefulWidget {
  const DummyScreen({super.key});

  @override
  State<DummyScreen> createState() => _DummyScreenState();
}

class _DummyScreenState extends State<DummyScreen> with WidgetsBindingObserver {
  bool isLaunched = false;

  @override
  void initState() {
    super.initState();
    WidgetsBinding.instance.addObserver(this);
    if (WidgetsBinding.instance.lifecycleState != null) {
      if (WidgetsBinding.instance.lifecycleState == AppLifecycleState.resumed) {
        openHomeScreen();
      }
    }
  }

  @override
  void didChangeAppLifecycleState(AppLifecycleState state) {
    super.didChangeAppLifecycleState(state);
    if (state == AppLifecycleState.resumed) {
      openHomeScreen();
    }
  }

  @override
  void dispose() {
    super.dispose();
    WidgetsBinding.instance.removeObserver(this);
  }

  Future<void> openHomeScreen() async {
    if (!isLaunched) {
      isLaunched = true;
      await Future.delayed(const Duration(milliseconds: 100));
      if (mounted) {
        // navigator push
      }
    }
  }

  @override
  Widget build(BuildContext context) {
    return Container();
  }
}

@adar2378
Copy link

This bug holds back the feature to show user action when app is terminated as the onBackgroundMessage callback is not called?

True, it is a problem to handle user action in terminated state for iOS

@adar2378
Copy link

@adar2378 We implemented something like this

void main() {
  // fireabase initialization
  // firebase messaging on background call
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const DummyScreen(),
    );
  }
}

class DummyScreen extends StatefulWidget {
  const DummyScreen({super.key});

  @override
  State<DummyScreen> createState() => _DummyScreenState();
}

class _DummyScreenState extends State<DummyScreen> with WidgetsBindingObserver {
  bool isLaunched = false;

  @override
  void initState() {
    super.initState();
    WidgetsBinding.instance.addObserver(this);
    if (WidgetsBinding.instance.lifecycleState != null) {
      if (WidgetsBinding.instance.lifecycleState == AppLifecycleState.resumed) {
        openHomeScreen();
      }
    }
  }

  @override
  void didChangeAppLifecycleState(AppLifecycleState state) {
    super.didChangeAppLifecycleState(state);
    if (state == AppLifecycleState.resumed) {
      openHomeScreen();
    }
  }

  @override
  void dispose() {
    super.dispose();
    WidgetsBinding.instance.removeObserver(this);
  }

  Future<void> openHomeScreen() async {
    if (!isLaunched) {
      isLaunched = true;
      await Future.delayed(const Duration(milliseconds: 100));
      if (mounted) {
        // navigator push
      }
    }
  }

  @override
  Widget build(BuildContext context) {
    return Container();
  }
}

Thanks, will check

@Joseph-Nathan
Copy link

is there any solution ??

@jinnyum
Copy link

jinnyum commented Jul 14, 2023

Oh my God, it's been 2 years and it's still not resolved?

@adar2378
Copy link

Oh my God, it's been 2 years and it's still not resolved?

Unfortunately yes 😥

@jinnyum
Copy link

jinnyum commented Jul 14, 2023

Many years have passed. Please tell me why it is not being fixed...
Is it a bug that can't be fixed?
We are planning a new program in the future.
We need to know when this bug will be fixed so that we can plan.
Can you tell us some future plans or timelines for this bug?

@abdalmonem
Copy link

did any one find a way to check whether the app open from background or normal open ?

@jinnyum
Copy link

jinnyum commented Jul 23, 2023

did any one find a way to check whether the app open from background or normal open ?

please check
#6517

@abdalmonem
Copy link

did any one find a way to check whether the app open from background or normal open ?

please check #6517

thanks for your reply , but its the same issue as this, but not answering my question ... i found :
#7407 (comment)
can help to turn around the issue , its not solve the issue , but can help at least to avoid any heavy work on the main isolate when call come from termination , i test it now and its works

@jinnyum
Copy link

jinnyum commented Jul 23, 2023

did any one find a way to check whether the app open from background or normal open ?

please check #6517

thanks for your reply , but its the same issue as this, but not answering my question ... i found : #7407 (comment) can help to turn around the issue , its not solve the issue , but can help at least to avoid any heavy work on the main isolate when call come from termination , i test it now and its works

I'll check it out
thank you

@adar2378
Copy link

I think the firebase team should collaborate with Flutter team resolve this. It's one of the core features I think when it comes to messaging app and replying from notifications directly etc.

@agladzegi
Copy link

Hello, any updates on this issue? the AppLifecycleState.resumed workaround does the trick but still, would be nice to see this fixed.

@phamquoctrongnta
Copy link

This issue still occurs in firebase_messaging: ^14.6.8.
Any update for this issue?

@ricnaaru
Copy link

I paste the solution here. Hope it works on you guys also

@abo-el30la
Copy link

This issue still occurs in firebase_messaging: ^14.6.8.
Any update for this issue?

@BryanAguer0
Copy link

@vishnukvmd How are you terminating the app ? Is it by swiping away from recent screens ? If so, in that case we need to manually re-open the app again for messages to start working. Can you try the same and see if this aspect helps ?
hello @darshankawar , where do you find this information? I am debugging exactly this issue and looking for some reference about it. Could you please give me some reference about this behaviour? Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform: ios Issues / PRs which are specifically for iOS. plugin: messaging type: bug Something isn't working type: documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests