You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: Support multiple pending ForEachAppDelegateClass blocks
Modified `util_ios.mm` to support queueing multiple blocks (up to 8,
defined by `MAX_PENDING_APP_DELEGATE_BLOCKS`) if `ForEachAppDelegateClass`
is called before `[UIApplication setDelegate:]` is invoked.
Changes include:
- Replaced single pending block storage with a C array of block pointers
and a counter (`g_pending_app_delegate_blocks` and `g_pending_block_count`).
- `ForEachAppDelegateClass` now adds blocks to this array if the app
delegate is not yet known. If the array is full, an error is logged
and the block is discarded.
- `Firebase_setDelegate` (the swizzled method) now iterates through all
pending blocks in the array. If a valid delegate is being set, it
executes each pending block. If the delegate is being set to nil,
it clears all pending blocks. The array count is reset in both cases.
- Added `#define MAX_PENDING_APP_DELEGATE_BLOCKS 8` for configurability.
NSLog(@"Firebase: ForEachAppDelegateClass - delegate class not yet known. Saved block for later execution (pending count: %d).", g_pending_block_count);
172
+
} else {
173
+
NSLog(@"Firebase Error: ForEachAppDelegateClass - pending block queue is full (max %d). Discarding new block.", MAX_PENDING_APP_DELEGATE_BLOCKS);
0 commit comments