Skip to content

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

Closed
@BaliakaIriana

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>

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