[cloud_functions]: Apple platforms ignore custom domains passed as region
维护者通常 4 天内回复
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 78/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
调研方向
从 iOS 和 macOS 共用的 FirebaseFunctionsPlugin.swift 开始,跟踪参数 region 如何传递到 Functions.functions(app:region:)。将该调用与 iOS/macOS SDK 的工厂方法 Functions.functions(app:customDomain:),以及 issue 中描述的 Android 和 Web 处理方式进行比较。完成标准是:在 Apple 平台上,自定义域名 URL 会传递给自定义域名工厂方法,而普通的 region 值仍使用 region 工厂方法。
由索引模型根据 Issue 内容生成。
描述
[cloud_functions]: Apple platforms ignore custom domains passed as region
Which plugins are affected?
Functions
Which platforms are affected?
iOS, macOS
Description
The Android and web Firebase SDKs accept a custom domain in the same
parameter as a region — regionOrCustomDomain. On Android,
FirebaseFunctions.getInstance(app, regionOrCustomDomain) URL-parses the
value and switches to custom-domain mode when it is a URL; the JS SDK's
getFunctions(app, regionOrCustomDomain) does the same.
The Firebase iOS/macOS SDKs also support custom domains, but through a
separate factory: Functions.functions(app:customDomain:). When a custom
domain string is passed to Functions.functions(app:region:) instead, the
SDK interpolates it into the host and produces a malformed URL such as
https://https://example.com-project.cloudfunctions.net/name.
The Flutter plugin always calls Functions.functions(app:region:) and
never exposes the customDomain: factory, so on Apple platforms there is
no way to reach a function through a custom domain — for example a
Google Cloud Load Balancer fronting Cloud Armor, where the function must
be called at https://api.example.com/functionName rather than the
cloudfunctions.net host.
Reproducing the issue
- Deploy a callable function behind a custom domain.
- Call
FirebaseFunctions.instanceFor(region: 'https://api.example.com').httpsCallable('myFunction').call(). - On Android and web the call reaches the custom domain. On iOS/macOS it
fails: the plugin passes the URL string as a region, and the SDK builds
an invalidcloudfunctions.netURL.
Suggested fix
In FirebaseFunctionsPlugin.swift (shared by iOS and macOS), detect an
http prefix in the region argument and call
Functions.functions(app:customDomain:) instead — matching the
region-or-custom-domain convention the other SDKs already use. This adds
no public Dart API surface.
- 主要语言
- Dart
- 星标
- 9.3k
- 派生
- 4.1k
- 平均合并
- 4 天 17 小时
- 30 天内合并 PR
- 49
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
firebase/flutterfire 的其他 Issue
-
Needs Attention platform: android plugin: messaging type: bug
难度 4/5 3-5 天 新手友好度 45/100
firebase/flutterfire#19017 ·
维护者通常 4 天内回复
-
Needs Attention platform: web plugin: crashlytics type: enhancement
难度 5/5 一周以上 新手友好度 34/100
firebase/flutterfire#19014 · 1 条评论 ·
维护者通常 4 天内回复
-
[firebase_messaging]: Android getToken() errors lose their cause since firebase-messaging 25.1.0 ("FCM Registration failed!")可能已有人在做 @SelaseKay 于 3 天前认领。 未关闭Needs Attention platform: android plugin: messaging reproduced type: bug
难度 4/5 3-5 天 新手友好度 22/100
firebase/flutterfire#18997 · 1 条评论 ·
维护者通常 4 天内回复
-
[firebase_storage]: Windows: getData() crashes with access violation (use-after-free of StorageReference in ReferenceGetData)可能已有人在做 @SelaseKay 于 4 天前认领。 未关闭blocked: customer-response platform: windows plugin: storage type: bug type: crash
难度 4/5 3-5 天 新手友好度 35/100
firebase/flutterfire#18994 · 2 条评论 ·
维护者通常 4 天内回复
-
[firebase_auth_web]: Make the Auth emulator persistence from #18926 configurable instead of hard-gated on kDebugMode可能已有人在做 @SelaseKay 于 2 天前认领。 未关闭Needs Attention platform: web plugin: auth type: enhancement
难度 3/5 1-2 天 新手友好度 62/100
firebase/flutterfire#18992 · 1 条评论 ·
维护者通常 4 天内回复
查看 firebase/flutterfire 的全部 Issue
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 72/100
hajisensai/Fushi#4543 · 3 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
dart-lang/dart_style#1928 ·
-
难度 1/5 1 小时以内 新手友好度 88/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 88/100
chriskelly/wish-together#212 ·
维护者通常 1 天内回复