Skip to content

[iOS] Quick Actions Not Triggered When App is in Background #169928

Closed

Description

@BaliakaIriana

Steps to reproduce

❗ Description
On iOS, when the app is in the background, tapping on a registered Quick Action does not execute the expected logic. However, the same Quick Action works correctly when:

  • The app is terminated
  • The app is in any state on Android

To reproduce:

  1. Install and configure quick_actions package
  2. Register Quick Actions in main()
  3. Run app on iOS
  4. Put app in background (press home button or swipe)
  5. Trigger a Quick Action from the home screen icon
  6. Observe: app resumes, but no logic is executed

Expected results

Quick Actions should trigger the registered handler and perform the corresponding action even when the app is in the background.

Actual results

On iOS:

App resumes (comes to foreground) but the Quick Action callback is not invoked.

No navigation or logic tied to the action is triggered.

On Android:

Quick Actions work perfectly regardless of app state (background, foreground, or terminated).

Code sample

Code sample
import 'package:flutter/material.dart';
import 'package:quick_actions/quick_actions.dart';

import 'src/presentation/features/auth/pages/login_screen.dart';

void main() {
  runApp(const MyApp());
}

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

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  late final QuickActions actions;

  @override
  void initState() {
    actions = QuickActions();
    actions.initialize((type) {
      switch (type) {
        case 'action_one':
          ScaffoldMessenger.of(context).showSnackBar(
            const SnackBar(content: Text('Action One Triggered')),
          );
          break;
        case 'action_two':
          ScaffoldMessenger.of(context).showSnackBar(
            const SnackBar(content: Text('Action Two Triggered')),
          );
          break;
        default:
          break;
      }
    });
    actions.setShortcutItems([
      const ShortcutItem(type: 'action_one', localizedTitle: 'Action One', icon: 'icon_one'),
      const ShortcutItem(type: 'action_two', localizedTitle: 'Action Two', icon: 'icon_two'),
    ]);
    super.initState();
  }
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.red),
        useMaterial3: true,
      ),
      home: const LoginScreen(),
    );
  }
}

Screenshots or Video

Screenshots / Video demonstration

[Upload media here]

Logs

Logs
[Paste your logs here]

Flutter Doctor output

Doctor output
[!] Flutter (Channel [user-branch], 3.24.5, on macOS 15.4.1 24E263 darwin-arm64, locale fr-MG)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 16.2)
[✓] Android Studio (version 2024.3)
[✓] VS Code (version 1.100.2)```

</details>

Activity

  1. tirth-patel-nc commented on Jun 4, 2025

    @tirth-patel-nc
    Member

    Triage Report

    I was able to reproduce the issue using the provided steps on master (3.33.0-1.0.pre.365) channels with quick_actions 1.1.0 on iOS. However on stable (3.32.1) it is working fine. Android is working fine on both flutter versions.

    Code Sample
    import 'package:flutter/material.dart';
    import 'package:quick_actions/quick_actions.dart';
    
    void main() {
      runApp(const MaterialApp(home: Scaffold(body: MyApp())));
    }
    
    class MyApp extends StatefulWidget {
      const MyApp({super.key});
    
      @override
      State<MyApp> createState() => _MyAppState();
    }
    
    class _MyAppState extends State<MyApp> {
      late final QuickActions actions;
    
      @override
      void initState() {
        super.initState();
        actions = QuickActions();
        actions.initialize((type) {
          switch (type) {
            case 'action_one':
              ScaffoldMessenger.of(
                context,
              ).showSnackBar(const SnackBar(content: Text('Action One Triggered')));
              break;
            case 'action_two':
              ScaffoldMessenger.of(
                context,
              ).showSnackBar(const SnackBar(content: Text('Action Two Triggered')));
              break;
            default:
              break;
          }
        });
        actions.setShortcutItems([
          const ShortcutItem(
            type: 'action_one',
            localizedTitle: 'Action One',
            icon: 'icon_one',
          ),
          const ShortcutItem(
            type: 'action_two',
            localizedTitle: 'Action Two',
            icon: 'icon_two',
          ),
        ]);
      }
    
      @override
      Widget build(BuildContext context) {
        return Center(child: Text('Test'));
      }
    }
    Flutter Version Video
    3.32.1 Stable
    Screen.Recording.2025-06-04.at.3.51.33.PM.mov
    3.33.0-1.0.pre.365 Master
    Screen.Recording.2025-06-04.at.3.55.20.PM.mov

    #130243 might be related.

  2. added
    packageflutter/packages repository. See also p: labels.
    has reproducible stepsThe issue has been confirmed reproducible and is ready to work on
    platform-iosiOS applications specifically
    team-iosOwned by iOS platform team
    c: regressionIt was better in the past than it is now
    and removed
    in triagePresently being triaged by the triage team
    on Jun 4, 2025
  3. added
    triaged-iosTriaged by iOS platform team
    P2Important issues not at the top of the work list
    on Jun 5, 2025
  4. LongCatIsLooong commented on Jun 5, 2025

    @LongCatIsLooong
    Contributor
  5. jmagman commented on Jun 6, 2025

    @jmagman
    Member

    I suspect related to the recent scene delegate adoption migration #167267.

    #130243 is probably describing the right fix, which is to hook up quick_actions with the scene delegate lifecycle.

  6. jmagman commented on Jun 6, 2025

    @jmagman
    Member

    Integration test failure: flutter/packages#9402 (comment)
    testQuickActionWhenAppIsInBackground() and testQuickActionWithFreshStart()

  7. stuartmorgan-g commented on Jun 9, 2025

    @stuartmorgan-g
    Contributor

    Integration test failure: flutter/packages#9402 (comment) testQuickActionWhenAppIsInBackground() and testQuickActionWithFreshStart()

    I'm disabling these tests in flutter/packages#9407 to get the roller working again, so part of closing this issue should be waiting for the engine change to roll into flutter/plugins and then re-enabling those tests (or a new issue should be filed to track that).

  8. added a commit that references this issue on Jun 10, 2025
  9. added a commit that references this issue on Jun 25, 2025
  10. github-actions commented on Jul 2, 2025

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  11. locked as resolved and limited conversation to collaborators on Jul 2, 2025
  12. hellohuanlin commented on Aug 11, 2026

    @hellohuanlin
    Contributor

    Note: the test still fails after #170180 is landed.

    See: #190966

    CC @gaaclarke

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listc: regressionIt was better in the past than it is nowfound in release: 3.33Found to occur in 3.33has reproducible stepsThe issue has been confirmed reproducible and is ready to work onp: quick_actionsQuickActions pluginpackageflutter/packages repository. See also p: labels.platform-iosiOS applications specificallyr: fixedIssue is closed as already fixed in a newer versionteam-iosOwned by iOS platform teamtriaged-iosTriaged by iOS platform team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions