Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update android-prefix validation to only check for bnc.lt #704

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
21 changes: 7 additions & 14 deletions src/scripts/android/updateAndroidManifest.js
Original file line number Diff line number Diff line change
Expand Up @@ -275,21 +275,14 @@
intentFilterData.push(getAppLinkIntentFilterDictionary(linkDomain));
intentFilterData.push(getAppLinkIntentFilterDictionary(alternate));
} else {
// bnc.lt
if (
linkDomain.indexOf("bnc.lt") !== -1 &&
preferences.androidPrefix === null
) {
throw new Error(
'BRANCH SDK: Invalid "android-prefix" in <branch-config> in your config.xml. Docs https://goo.gl/GijGKP'
preferences.androidPrefix.forEach(prefix => {
intentFilterData.push(
getAppLinkIntentFilterDictionary(
linkDomain,
prefix
)
);
}
intentFilterData.push(
getAppLinkIntentFilterDictionary(
linkDomain,
preferences.androidPrefix
)
);
})
}
}

Expand Down
3 changes: 2 additions & 1 deletion src/scripts/npm/processConfigXml.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
iosTeamRelease: getBranchValue(branchXml, "ios-team-release"), // optional
iosTeamDebug: getBranchValue(branchXml, "ios-team-debug"), // optional
androidBundleId: getBundleId(configXml, "android"), // optional
androidPrefix: getBranchValue(branchXml, "android-prefix"), // optional
androidPrefix: getBranchLinkDomains(branchXml, "android-prefix"), // optional
androidTestMode: getBranchValue(branchXml, "android-testmode") // DEPRECATED optional
};
}
Expand Down Expand Up @@ -294,6 +294,7 @@
);
}
if (
[...preferences.linkDomain, ...preferences.androidLinkDomain, preferences.iosLinkDomain].find(domain => domain === 'bnc.lt') &&
preferences.androidPrefix !== null &&
!/^[/].[a-zA-Z0-9]{3,4}$/.test(preferences.androidPrefix)
) {
Expand Down