Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

[Bug] [iOS] App delegate swizzler has no UIScene equivalent — cold-launch & universal links miss Analytics/Dynamic Links on scene-based apps

未关闭
#1,892 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
45/100
Issue 类型
缺陷
描述清晰度
需要澄清
活跃度
活跃
技术栈
cpp, firebase, ios, unity

调研方向

从 app/src/invites/ios/invites_ios_startup.mm 开始,阅读 RunOnAppDelegateClasses 和 HookAppDelegateMethods,以及列出的 UIApplicationDelegate hooks。跟踪 issue 中描述的 scene delegate 传递路径,并确定如何在保留原始实现的同时让覆盖范围触达 Dynamic Links 和 Analytics;完成的标准是,报告中的 cold-launch 和已连接 scene 的 URL 及 user-activity 路径不再被静默丢弃。

由索引模型根据 Issue 内容生成。

描述

new type: question
Environment
  • Platform: iOS (scene-based lifecycle, UIWindowSceneDelegate)
  • Firebase C++ SDK version: (also consumed via Firebase Unity SDK 12.10.1)
  • Installed via: Unity (FirebaseCppApp / FirebaseCppAnalytics), with FirebaseAnalytics/FirebaseCore pods 11.14.0, GoogleUtilities 8.1.2
  • Relevant products: Analytics (campaign attribution)
Problem Description

The C++ SDK's iOS app-delegate swizzler (app/src/invites/ios/invites_ios_startup.mm, hooking installed via +load → RunOnAppDelegateClasses → HookAppDelegateMethods) only replaces UIApplicationDelegate methods:

  • application:openURL:options:
  • application:openURL:sourceApplication:annotation:
  • application:continueUserActivity:restorationHandler:
  • applicationDidBecomeActive:

There is no UISceneDelegate/UIWIndowSceneDelegate handling anywhere in the C++ SDK (looking at unity-v12.10.1 and v13.10.0)

On modern scene-based apps (UIWindowSceneDelegate), URL/NSUserActivity delivery moves off the app delegate onto the scene delegate. The C++ SDK adds nothing on top. As a result these link-delivery paths reach neither the C++ Dynamic Links machinery nor Analytics:

  • scene:willConnectToSession:options: — cold-launch deep links (connectionOptions.URLContexts) and cold-launch universal links (connectionOptions.userActivities)
  • scene:openURLContexts: — deep links delivered while the scene is already connected
  • scene:continueUserActivity: — universal links delivered while the scene is already connected

Impact: on scene-based iOS apps, cold-launch deep/universal links and connected-scene universal links are silently dropped by the SDK.

Steps to reproduce:
  1. Scene-based iOS app (Unity export uses UnityScene : UIWindowSceneDelegate in their latest Editor versions).
  2. Register a Dynamic Link / campaign URL.
  3. Cold-launch the app via a universal link → delivered to scene:willConnectToSession:options:.
  4. Observe: no firebase::/GUL frame in the stack for that delivery; no Dynamic Link resolution; no Analytics campaign event. (Same for scene:continueUserActivity: or scene:openURLContexts: while connected.)
Question for maintainers:
  • Is scene-delegate support planned for the C++ SDK's swizzler?
Workaround we're using (and would like validated):

We swizzle only the three uncovered scene methods on the scene delegate and forward to [FIRAnalytics handleOpenURL:] / [FIRAnalytics handleUserActivity:], chaining to the original implementation so the engine's own deep-link handling is preserved. Is this the recommended approach, and is there any double-handling risk if the SDK later completes scene coverage?

主要语言
C++
星标
326
派生
138
平均合并
2 天 16 小时
30 天内合并 PR
3

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

firebase/firebase-cpp-sdk 的其他 Issue

查看 firebase/firebase-cpp-sdk 的全部 Issue

相似的 Issue

更多 C++ Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。