-
Notifications
You must be signed in to change notification settings - Fork 132
Description
Summary
We're setting our branch API key via our EAS env in app.config.ts, but the current structure of the config plugin causes eas build to fail in this scenario.
eas build will first attempt to pull the env from EAS, and as part of this will run the equivalent of eas config, but because the react-native-branch plugin is checking for the presence of the API key during the config phase instead of during the mods phase, eas config will fail as the key is not yet set.
I believe the solution is to just move the apiKey check inside of withAndroidManifest and withInfoPlist.
Config Plugin
@config-plugins/react-native-branch
What platform(s) does this occur on?
Android, iOS
SDK Version
53
Reproducible demo
In app.config.ts:
plugins: [
[
'@config-plugins/react-native-branch',
{
apiKey: process.env.BRANCH_API_KEY
}
]
]
And then in EAS define BRANCH_API_KEY as an env variable. Running eas config (or eas build) will fail.
(One workaround is to set the env variable to any value while running the eas build command:
BRANCH_API_KEY=dummy `eas build...`