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

Avoid double callback of fetchCompletionHandler in didReceiveRemoteNotification #108

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pletoss
Copy link

@pletoss pletoss commented Feb 14, 2025

This PR addresses issue #107 by preventing a double invocation of fetchCompletionHandler in didReceiveRemoteNotification.

Currently, the handler is called twice—once by the superclass (UnityAppController) and once in BrazeKit—which can lead to crashes (notably with GoogleUtilities). The fix introduces a localCompletionHandler and uses a dispatch group to wait for all callbacks before aggregating their results and calling the original completion handler exactly once.

…tification

Use a callbackGroup to wait for all fetchCompletionHandler callbacks and aggregate result, then call original completion handler one single time
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

Successfully merging this pull request may close these issues.

1 participant