@advenue/react-native 0.3.1 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/plugin/links.js CHANGED
@@ -4,6 +4,22 @@
4
4
 
5
5
  const ASSOC_KEY = 'com.apple.developer.associated-domains';
6
6
 
7
+ // The shared Advenue cloud link domain (dashboard short links live under
8
+ // go.advenue.io/<prefix>, and the same host serves the AASA / assetlinks.json
9
+ // association files). Self-hosters and custom link domains override via props.
10
+ const DEFAULT_LINK_DOMAIN = 'go.advenue.io';
11
+
12
+ /**
13
+ * Resolves the link domains from the plugin props: the provided list verbatim,
14
+ * or the Advenue cloud default when absent/empty.
15
+ * @param {{ domains?: string[] } | undefined} props
16
+ * @returns {string[]}
17
+ */
18
+ function resolveDomains(props) {
19
+ const domains = props?.domains ?? [];
20
+ return domains.length > 0 ? domains : [DEFAULT_LINK_DOMAIN];
21
+ }
22
+
7
23
  /**
8
24
  * Returns a copy of the iOS entitlements with `applinks:<domain>` added for each
9
25
  * domain (deduped, existing entries preserved). Enables iOS Universal Links.
@@ -76,4 +92,10 @@ function addAppLinksIntentFilter(manifest, domains) {
76
92
  return manifest;
77
93
  }
78
94
 
79
- module.exports = { addAssociatedDomains, addAppLinksIntentFilter, ASSOC_KEY };
95
+ module.exports = {
96
+ addAssociatedDomains,
97
+ addAppLinksIntentFilter,
98
+ resolveDomains,
99
+ ASSOC_KEY,
100
+ DEFAULT_LINK_DOMAIN,
101
+ };