Skip to content

feat: add additional scene delegate methods#242

Draft
daymxn wants to merge 7 commits into
mainfrom
dlr/expand-scene-delegate-swizzler
Draft

feat: add additional scene delegate methods#242
daymxn wants to merge 7 commits into
mainfrom
dlr/expand-scene-delegate-swizzler

Conversation

@daymxn

@daymxn daymxn commented Jul 9, 2026

Copy link
Copy Markdown
Member

Per b/532968854,

This adds functionality to GULSceneDelegateSwizzler to properly proxy both scene:willConnectToSession:options: and scene:continueUserActivity:, as the alternatives were already being proxied within the app delegate swizzler.

Tests have also been added for these. Note that these methods check if the developer already had an implementation, and call it directly instead of handling it in those cases. This should ensure that existing implementations aren't broken by this change.

This PR also removes a small bit of redundant code in the scene:openURLContexts: proxy method. The code was previously explicitly checking protocol conformance and casts inside the interceptor block, but this was already being performed by the parent notifyInterceptorsWithMethodSelector method, so it's a bit redundant.

Furthermore, this PR adds a bit of code that will also attempt to proxy existing scene delegates that were already connected when our code started. It may not be an issue, but with the lifecycle nuances of newer Swift ecosystems (especially around Scenes), I thought it better safe than sorry; as it could also address any potential edge-cases.

@daymxn daymxn self-assigned this Jul 9, 2026
@daymxn daymxn marked this pull request as ready for review July 9, 2026 15:58
@daymxn daymxn requested review from ncooke3 and paulb777 July 9, 2026 15:58
@ncooke3

ncooke3 commented Jul 9, 2026

Copy link
Copy Markdown
Member

/gemini review

Comment thread GoogleUtilities/AppDelegateSwizzler/GULSceneDelegateSwizzler.m Outdated
Comment thread GoogleUtilities/AppDelegateSwizzler/GULSceneDelegateSwizzler.m Outdated
@daymxn daymxn requested a review from ncooke3 July 9, 2026 16:30
@ncooke3 ncooke3 removed the request for review from paulb777 July 9, 2026 19:53
@ncooke3 ncooke3 marked this pull request as draft July 9, 2026 19:53
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.

2 participants