diff --git a/.changes/fix-deep-link-ios-url-types.md b/.changes/fix-deep-link-ios-url-types.md new file mode 100644 index 0000000000..14da4aa943 --- /dev/null +++ b/.changes/fix-deep-link-ios-url-types.md @@ -0,0 +1,10 @@ +--- +"deep-link": patch +--- + +Fixed an iOS regression where deep link URL types were generated from app links instead of custom URL schemes, which could prevent custom schemes from being registered correctly. + +Also updated the generated iOS `CFBundleURLName` to use `$(PRODUCT_BUNDLE_IDENTIFIER).{scheme}`. + +And added handling for `webcredentials:` in iOS entitlements + diff --git a/plugins/deep-link/build.rs b/plugins/deep-link/build.rs index f308ffe5f0..9dfe21b797 100644 --- a/plugins/deep-link/build.rs +++ b/plugins/deep-link/build.rs @@ -128,7 +128,13 @@ fn main() { .iter() .filter(|d| d.is_app_link()) .filter_map(|d| d.host.as_ref()) - .map(|host| format!("applinks:{}", host).into()) + .flat_map(|host| { + [ + format!("applinks:{}", host), + format!("webcredentials:{}", host), + ] + }) + .map(Into::into) .collect::>() .into(), ); @@ -139,7 +145,7 @@ fn main() { let deep_link_domains = config .mobile .iter() - .filter(|domain| !domain.is_app_link()) + .filter(|domain| !domain.is_web_link()) .collect::>(); if deep_link_domains.is_empty() { @@ -173,7 +179,8 @@ fn main() { ); dict.insert( "CFBundleURLName".into(), - domain.scheme[0].clone().into(), + format!("$(PRODUCT_BUNDLE_IDENTIFIER).{}", domain.scheme[0]) + .into(), ); plist::Value::Dictionary(dict) })