Skip to content

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

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

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ SOFTWARE.
<plugins-plist key="BranchSDK" string="BranchSDK" />

<config-file target="config.xml" parent="/*">
<preference name="deployment-target" value="12.0" />
<preference name="deployment-target" value="13.0" />
<feature name="BranchSDK">
<param name="ios-package" value="BranchSDK" />
<param name="onload" value="true" />
Expand Down
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