Skip to content

[Bug]: addClickListener not working in IOS when app is in terminated state. #1059

@preteambuy

Description

@preteambuy

What happened?

Tapping on the message when the app is in killed state doesnt trigger addClickListener

Steps to reproduce?

1. Installed 5.3.4 Version
2. Initialize the code like below before the runApp 

static Future<void> initialize() async {
    final AppConfig appConfig = locator<AppConfig>();
    OneSignal.initialize(appConfig.oneSignalAppId);

    OneSignal.Notifications.addClickListener(_onNotificationOpened);
    OneSignal.Notifications.addForegroundWillDisplayListener(_onNotificationReceivedInForeground);
  }

3. The push notification handler works when the app is in the background or foreground.
4. When the app is in killed state, and when i tap on the message, the "_onNotificationOpened" function isnt trigggered.
5. This is on IOS platform

What did you expect to happen?

I expected the app to trigger the function on tapping the push notification.

OneSignal Flutter SDK version

5.3.4

Which platform(s) are affected?

  • iOS
  • Android

Relevant log output

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions