|
182 | 182 | // determine the Branch link domain <data> to append to the App Link intent filter |
183 | 183 | function getAppLinkIntentFilterData (preferences) { |
184 | 184 | var intentFilterData = [] |
185 | | - |
186 | | - if (preferences.linkDomain.indexOf('app.link') !== -1) { |
187 | | - // app.link needs an additional -alternate link domain |
188 | | - var first = preferences.linkDomain.split('.')[0] |
189 | | - var rest = preferences.linkDomain.split('.').slice(2).join('.') |
190 | | - var alternate = first + '-alternate' + '.' + rest |
191 | | - |
192 | | - intentFilterData.push(getAppLinkIntentFilterDictionary(preferences.linkDomain)) |
193 | | - intentFilterData.push(getAppLinkIntentFilterDictionary(alternate)) |
194 | | - } else if (preferences.linkDomain.indexOf('bnc.lt') !== -1) { |
195 | | - // bnc.lt |
196 | | - if (preferences.androidPrefix == null) { |
197 | | - throw new Error('BRANCH SDK: Missing "android-prefix" in <branch-config> in your config.xml. Docs https://goo.gl/GijGKP') |
| 185 | + var linkDomains = preferences.linkDomain |
| 186 | + |
| 187 | + for (var i = 0; i < linkDomains.length; i++) { |
| 188 | + var linkDomain = linkDomains[i] |
| 189 | + |
| 190 | + // app.link link domains need -alternate associated domains as well (for Deep Views) |
| 191 | + if (linkDomain.indexOf('app.link') !== -1) { |
| 192 | + var first = linkDomain.split('.')[0] |
| 193 | + var rest = linkDomain.split('.').slice(2).join('.') |
| 194 | + var alternate = first + '-alternate' + '.' + rest |
| 195 | + |
| 196 | + intentFilterData.push(getAppLinkIntentFilterDictionary(linkDomain)) |
| 197 | + intentFilterData.push(getAppLinkIntentFilterDictionary(alternate)) |
| 198 | + } else if (linkDomain.indexOf('bnc.lt') !== -1) { |
| 199 | + // bnc.lt |
| 200 | + if (preferences.androidPrefix == null) { |
| 201 | + throw new Error('BRANCH SDK: Missing "android-prefix" in <branch-config> in your config.xml. Docs https://goo.gl/GijGKP') |
| 202 | + } |
| 203 | + intentFilterData.push(getAppLinkIntentFilterDictionary(linkDomain, preferences.androidPrefix)) |
| 204 | + } else { |
| 205 | + // custom |
| 206 | + intentFilterData.push(getAppLinkIntentFilterDictionary(linkDomain)) |
198 | 207 | } |
199 | | - |
200 | | - intentFilterData.push(getAppLinkIntentFilterDictionary(preferences.linkDomain, preferences.androidPrefix)) |
201 | | - } else { |
202 | | - // custom |
203 | | - intentFilterData.push(getAppLinkIntentFilterDictionary(preferences.linkDomain)) |
204 | 208 | } |
205 | 209 |
|
206 | 210 | return intentFilterData |
|
0 commit comments