[cloud_functions]: Apple platforms ignore custom domains passed as region
Maintainers usually reply within 4 days
@ragavendranbala-TSL is already working on this.
Since Nov 27, 2026.
- #19016 by @ragavendranbala-TSL — open
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Domain
- backend-api-design, mobile
Research direction
Start with FirebaseFunctionsPlugin.swift, shared by iOS and macOS, and trace how the region argument reaches Functions.functions(app:region:). Compare that call with the iOS/macOS SDK’s Functions.functions(app:customDomain:) factory and the Android and web handling described in the issue. Done means custom-domain URLs reach the custom-domain factory on Apple platforms while ordinary region values keep using the region factory.
Written by the indexing model from the issue text.
Description
[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.
- Dominant language
- Dart
- Stars
- 9.3k
- Forks
- 4.1k
- Avg merge
- 4d 17h
- Merged PRs (30d)
- 49
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from firebase/flutterfire
-
Needs Attention platform: android plugin: messaging type: bug
Difficulty 4/5 3-5 days Newbie friendliness 45/100
firebase/flutterfire#19017 ·
Maintainers usually reply within 4 days
-
Needs Attention platform: web plugin: crashlytics type: enhancement
Difficulty 5/5 Over a week Newbie friendliness 34/100
firebase/flutterfire#19014 · 1 comment ·
Maintainers usually reply within 4 days
-
[firebase_messaging]: Android getToken() errors lose their cause since firebase-messaging 25.1.0 ("FCM Registration failed!")Possibly taken @SelaseKay claimed this 3 days ago. OpenNeeds Attention platform: android plugin: messaging reproduced type: bug
Difficulty 4/5 3-5 days Newbie friendliness 22/100
firebase/flutterfire#18997 · 1 comment ·
Maintainers usually reply within 4 days
-
[firebase_storage]: Windows: getData() crashes with access violation (use-after-free of StorageReference in ReferenceGetData)Possibly taken @SelaseKay claimed this 3 days ago. Openblocked: customer-response platform: windows plugin: storage type: bug type: crash
Difficulty 4/5 3-5 days Newbie friendliness 35/100
firebase/flutterfire#18994 · 2 comments ·
Maintainers usually reply within 4 days
-
[firebase_auth_web]: Make the Auth emulator persistence from #18926 configurable instead of hard-gated on kDebugModePossibly taken @SelaseKay claimed this 1 day ago. OpenNeeds Attention platform: web plugin: auth type: enhancement
Difficulty 3/5 1-2 days Newbie friendliness 62/100
firebase/flutterfire#18992 · 1 comment ·
Maintainers usually reply within 4 days
All issues in firebase/flutterfire
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
hajisensai/Fushi#4543 · 3 comments ·
Maintainers usually reply within 1 day
-
[video_player] _updatePosition sets isCompleted=true after 500ms when duration is Duration.zeroOpen
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
chriskelly/wish-together#212 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
spotiflacapp/SpotiFLAC-Mobile#984 ·