rafaelsetragni / awesome_notifications

A complete solution to create Local Notifications and Push Notifications, throught Firebase or another services, using Flutter.
https://discord.awesome-notifications.carda.me
Apache License 2.0
732 stars 322 forks source link

App opend from icon and getInitialNotificationAction returns value #801

Closed guyluz11 closed 4 months ago

guyluz11 commented 1 year ago

Rules

To report a bug and help us to provide the solution as fast as possible, please follow the instructions below:

1 - Describe the bug

A clear and concise description of what the bug is.

OBS: avoid using the expression "it's not working" or "is working" or any other variation. These expressions can mean anything but don´t bring any useful information. As soon you rewrite these expressions, you are naturally going to be more precise and clear.

After snoozing the notification using a snooze button on the notification and after that opening the app from the app icon the command AwesomeNotifications().getInitialNotificationAction(removeFromActionEvents: true) does not return null. Since the notification does not exist in the notification area and the app got opened from the app icon the expected result of AwesomeNotifications().getInitialNotificationAction(removeFromActionEvents: true) is to be null. Instead it returns the last action recorded - the snooze action.

2 - Provide us as much information as possible

To help us to understand your issue, provide with your bug report all the relevant informations, such as:

await AwesomeNotifications().initialize(
      'resource://drawable/notification',
      [
        NotificationChannel(
          channelGroupKey: NotificationsService.activityGroupKeyLocal,
          channelKey: localChannelKey,
          channelName: channelName,
          channelDescription: channelDescription,
        ),
        NotificationChannel(
            channelKey: remoteChannelKey,
            channelName: channelName,
            channelDescription: 'Notification alerts',
            importance: NotificationImportance.Max,
            defaultColor: const Color(0xFF9D50DD),
            ledColor: const Color.fromARGB(255, 190, 56, 56),
            groupKey: channelGroupKey,
            channelShowBadge: true)
      ],
      // Channel groups are only visual and are not required
      channelGroups: [
        NotificationChannelGroup(
          channelGroupKey: NotificationsService.activityGroupKeyLocal,
          channelGroupName: activityChannelGroupName,
        ),
        NotificationChannelGroup(
          channelGroupKey: NotificationsService.remoteNotificationGroupKey,
          channelGroupName: remoteChannelGroupName,
        ),
      ],
      debug: true,
    );

• No issues found!


OBS: To post a source code in your issue, please use the markdown below:

```Dart
print('Your source code goes here');

3 - How To Reproduce the Error

Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

...or if you prefer, you can provide us a simple example app on GitHub with the issue already reproduced instead of the steps 2 and 3.

4 - Expected behavior

When app is getting opened from the icon and not from notification action button the line AwesomeNotifications().getInitialNotificationAction(removeFromActionEvents: true) will return null

5 - Screenshots

If applicable, add screenshots to help explain your problem.

6 - Additional context

Add any other context about the problem here.

Tested on version awesome_notifications: ^0.7.5-dev.3 and also awesome_notifications: ^0.7.4+1

github-actions[bot] commented 11 months ago

This issue was automatically closed due inactivity, but can be reopened at any time.

guyluz11 commented 11 months ago

Should not get closed

rafaelsetragni commented 10 months ago

It is automatically closed if no one sent new answers, but i will reopen it.

This is an normal behavior on Android. If you had received an push notification and open the app through it, the app will be initiated using this "intent". If you close the app and reopen it using the task list, it will use the same intent as before. So, it will looks like you're open the app again tapping over the notification.

github-actions[bot] commented 8 months ago

This issue was automatically closed due inactivity, but can be reopened at any time.

guyluz11 commented 8 months ago

.

github-actions[bot] commented 6 months ago

This issue was automatically closed due inactivity, but can be reopened at any time.

guyluz11 commented 6 months ago

.

github-actions[bot] commented 4 months ago

This issue was automatically closed due inactivity, but can be reopened at any time.