File tree Expand file tree Collapse file tree 3 files changed +11
-3
lines changed
Firebase/DynamicLinks/Utilities Expand file tree Collapse file tree 3 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -290,7 +290,7 @@ - (void)_buildFDLLink {
290
290
NSURL *link = [NSURL URLWithString: _paramValues[@" linkString" ]];
291
291
FIRDynamicLinkComponents *components =
292
292
[FIRDynamicLinkComponents componentsWithLink: link
293
- domainURIPrefix: _paramValues[@" https://domain " ]];
293
+ domainURIPrefix: _paramValues[@" domainURIPrefix " ]];
294
294
295
295
FIRDynamicLinkGoogleAnalyticsParameters *analyticsParams =
296
296
[FIRDynamicLinkGoogleAnalyticsParameters
Original file line number Diff line number Diff line change @@ -1032,6 +1032,12 @@ - (void)testValidCustomDomainNames {
1032
1032
@" https://a.firebase.com/mypath/mylink" , // Short FDL starting https://a.firebase.com/mypath
1033
1033
@" https://a.firebase.com/mypath?link=abcd&test=1" , // Long FDL starting with
1034
1034
// https://a.firebase.com/mypath
1035
+ @" https://a.firebase.com/mypath/?link=https://www.google.com&test=1" // Long FDL coming from
1036
+ // the app preview page.
1037
+ // Note that the long FDL
1038
+ // coming from the
1039
+ // pasteboard has an extra
1040
+ // trailing slash.
1035
1041
];
1036
1042
1037
1043
for (NSString *urlString in urlStrings) {
Original file line number Diff line number Diff line change @@ -212,10 +212,12 @@ BOOL FIRDLIsURLForWhiteListedCustomDomain(NSURL *_Nullable URL) {
212
212
([urlStr characterAtIndex: domainURIPrefixStr.length] == ' /' ||
213
213
[urlStr characterAtIndex: domainURIPrefixStr.length] == ' ?' )) {
214
214
// Check if there are any more '/' after the first '/' or '?' trailing the
215
- // domainURIPrefix.
215
+ // domainURIPrefix. This does not apply to unique match links copied from the clipboard.
216
+ // The clipboard links will have '?link=' after the domainURIPrefix.
216
217
NSString *urlWithoutDomainURIPrefix =
217
218
[urlStr substringFromIndex: domainURIPrefixStr.length + 1 ];
218
- if ([urlWithoutDomainURIPrefix rangeOfString: @" /" ].location == NSNotFound ) {
219
+ if ([urlWithoutDomainURIPrefix rangeOfString: @" /" ].location == NSNotFound ||
220
+ [urlWithoutDomainURIPrefix rangeOfString: @" ?link=" ].location != NSNotFound ) {
219
221
customDomainMatchFound = true ;
220
222
break ;
221
223
}
You can’t perform that action at this time.
0 commit comments