Skip to content

Commit 0d8247e

Browse files
authored
Add a RegExp for iOS domain when reading domains from xcodeProject (flutter#154201)
Append the string `?mode=<alternate mode>` to the associated domain to enable alternate mode in some use cases is recommended in apple developer guide (https://developer.apple.com/documentation/xcode/configuring-an-associated-domain#Enable-alternate-mode-for-unreachable-servers) So when reading these domains from xcode settings, we should consider this case and trim it. ## Pre-launch Checklist - [ ] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [ ] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [ ] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [ ] I signed the [CLA]. - [ ] I listed at least one issue that this PR fixes in the description above. - [ ] I updated/added relevant documentation (doc comments with `///`). - [ ] I added new tests to check the change I am making, or this PR is [test-exempt]. - [ ] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [ ] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md [Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
1 parent 01e8eca commit 0d8247e

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

packages/flutter_tools/lib/src/xcode_project.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,8 @@ class IosProject extends XcodeBasedProject {
262262
static final RegExp _productBundleIdPattern = RegExp('^\\s*$kProductBundleIdKey\\s*=\\s*(["\']?)(.*?)\\1;\\s*\$');
263263
static const String _kProductBundleIdVariable = '\$($kProductBundleIdKey)';
264264

265-
static final RegExp _associatedDomainPattern = RegExp(r'^applinks:(.*)');
265+
// The string starts with `applinks:` and ignores the query param which starts with `?`.
266+
static final RegExp _associatedDomainPattern = RegExp(r'^applinks:([^?]+)');
266267

267268
Directory get ephemeralModuleDirectory => parent.directory.childDirectory('.ios');
268269
Directory get _editableDirectory => parent.directory.childDirectory('ios');

packages/flutter_tools/test/general.shard/project_test.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -920,6 +920,7 @@ plugins {
920920
<String>[
921921
'applinks:example.com',
922922
'applinks:example2.com',
923+
'applinks:example3.com?mode=developer',
923924
],
924925
);
925926
final String outputFilePath = await project.ios.outputsUniversalLinkSettings(
@@ -935,6 +936,7 @@ plugins {
935936
<String>[
936937
'example.com',
937938
'example2.com',
939+
'example3.com',
938940
],
939941
),
940942
);

0 commit comments

Comments
 (0)