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

[IOS] The onMessageReceivedInTheForeground callback triggers multiple times for a single notification #53

Open
ebabhi opened this issue Oct 4, 2024 · 0 comments

Comments

@ebabhi
Copy link

ebabhi commented Oct 4, 2024

Issue

When the app is in the foreground and receives a notification, the onMessageReceivedInTheForeground callback is triggered multiple times.

Expected Behaviour

onMessageReceivedInTheForeground should only be triggered once per notification.

Steps to replicate

  1. Set up Pusher Beams on iOS.
  2. Add a callback to onMessageReceivedInTheForeground.
  3. The callback will be triggered multiple times.

Logs from Xcode for a single notification

SwiftPusherBeamsPlugin: message received: ["body": "DEBUG", "data": Optional({
    pusher =     {
        instanceId = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx";
        publishId = "pubid-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx";
        userShouldIgnore = 1;
    };
}), "title": "DEBUG"]
flutter: {pusher: {userShouldIgnore: true, publishId: pubid-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx, instanceId: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}}
SwiftPusherBeamsPlugin: message received: ["body": "DEBUG", "data": nil, "title": "DEBUG"]
SwiftPusherBeamsPlugin: message received: ["body": "DEBUG", "data": Optional({
    pusher =     {
        instanceId = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx";
        publishId = "pubid-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx";
        userShouldIgnore = 1;
    };
}), "title": "DEBUG"]
flutter: null
flutter: {pusher: {userShouldIgnore: true, publishId: pubid-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx, instanceId: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}}
SwiftPusherBeamsPlugin: message received: ["body": "DEBUG", "data": nil, "title": "DEBUG"]
SwiftPusherBeamsPlugin: message received: ["body": "DEBUG", "data": nil, "title": "DEBUG"]
flutter: null
flutter: null
SwiftPusherBeamsPlugin: message received: ["body": "DEBUG", "data": nil, "title": "DEBUG"]
flutter: null
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