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
Feature: Allow specifying AppDelegate via Info.plist for RunOnAppDelegateClasses (Refined)
Currently, `firebase::util::RunOnAppDelegateClasses` on iOS automatically
swizzles `[UIApplication setDelegate:]` to capture and act on any class
set as the application delegate.
This change introduces an optional feature where developers can specify their
app's main AppDelegate class name directly in the `Info.plist` file using
the key `FirebaseAppDelegateClassName`.
If this key is present and provides a valid class name:
- `RunOnAppDelegateClasses` will only execute blocks for this specified class.
- Pending blocks are processed once for this target.
- New blocks execute immediately on this target and are not queued for others.
- `[UIApplication setDelegate:]` will NOT be swizzled by Firebase.
If the key is not present, is invalid, or the specified class is not found,
Firebase will fall back to the original behavior of swizzling
`[UIApplication setDelegate:]`.
This provides developers more control over Firebase's interaction with the
AppDelegate. The implementation of `RunOnAppDelegateClasses` has been refined
to support this new mode more simply while ensuring correct block execution
and pending queue management.
Detailed logging has been added. A manual testing plan is provided.
NSLog(@"Firebase: RunOnAppDelegateClasses (Swizzle Mode) - added block to pending list (total pending: %d). This block will run on future new delegate classes.", g_pending_block_count);
293
+
NSLog(@"Firebase: RunOnAppDelegateClasses (Swizzle Mode) - Added block to pending list (total pending: %d). This block will run on future new delegate classes.", g_pending_block_count);
300
294
} else {
301
-
NSLog(@"Firebase Error: RunOnAppDelegateClasses (Swizzle Mode) - pending block queue is full (max %d). Cannot add new block for future execution. Discarding block.", MAX_PENDING_APP_DELEGATE_BLOCKS);
295
+
NSLog(@"Firebase Error: RunOnAppDelegateClasses (Swizzle Mode) - Pending block queue is full (max %d). Cannot add new block for future execution. Discarding block.", MAX_PENDING_APP_DELEGATE_BLOCKS);
0 commit comments