We’ve observed a crash when integrating FirebaseMessaging / GoogleUtilities with the Braze Unity SDK. The issue appears to stem from using a dispatch group in the swizzled AppDelegate: if fetchCompletionHandler is invoked more than once (a behavior not explicitly disallowed by Apple’s docs), an imbalance occurs calling dispatch_group_leave more times than dispatch_group_enter triggers an exception.
References
Related issues:
- Intercom SDK Discussion
- Firebase iOS SDK Issue #8442
- Braze Unity SDK Issue #10
Suggested Resolution
Clarify (via Apple’s documentation or internal assumptions) whether fetchCompletionHandler is allowed to be called multiple times, or adjust GoogleUtilities to safely handle multiple invocations. This change would prevent not only the current crash but also avoid hard-to-debug issues with other libraries.