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

Notifications inside native app recreate entire app #2530

Open
ced1check opened this issue Feb 5, 2025 · 0 comments
Open

Notifications inside native app recreate entire app #2530

ced1check opened this issue Feb 5, 2025 · 0 comments

Comments

@ced1check
Copy link

ced1check commented Feb 5, 2025

Within a native app in Kotlin/Java, the flutter code is started after the login page. That code receives message from firebase which in turn create notification with the simple below code:

sl<FlutterLocalNotificationsPlugin>().show(id, title, body, platformChannelSpecifics, payload: payload);

Platform specifics on Android are as follows:

  AndroidNotificationDetails androidPlatformChannelSpecifics = const AndroidNotificationDetails(
    "COMPANY",
    "Company notifications",
    channelDescription: "Notifications for new messages",
    importance: Importance.defaultImportance,
    priority: Priority.defaultPriority,
    icon: "app_icon",
    channelAction: AndroidNotificationChannelAction.update,
  );

When tapping those notifications the app is re-created from scratch back to login page instead of being brought to front. Flutter code doesn't get the payload ever.
Even if the app is the top visible app and being used by user, tapping the notification recreates it!

What can I do to avoid that ?

EDIT: Tapping the notification launches the only activity flagged with "LAUNCHER", hence back to login page.
OS acts as if app is in background and reports this: Activity start ONLY allowed by BAL_ALLOW_NON_APP_VISIBLE_WINDOW

Where/how can I specify the notification intent to use ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant