Skip to content

Commit f02a43c

Browse files
committed
chore(react-native-branch): emit warning when apiKey from ExpoConfig.config is present
1 parent 0953290 commit f02a43c

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

‎packages/react-native-branch/src/withBranchAndroid.ts‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,12 @@ export const withBranchAndroid: ConfigPlugin<ConfigData> = (config, data) => {
6464
// config. The `branch` property in the Expo Config is deprecated and will be
6565
// removed in SDK 56.
6666
// TODO(@hassankhan): Remove fallback when updating for SDK 56
67+
if (config.android?.config?.branch?.apiKey) {
68+
console.warn(
69+
"react-native-branch: Using `config.android.config.branch.apiKey` is deprecated. " +
70+
"Pass `apiKey` directly in the plugin config instead.",
71+
);
72+
}
6773
const apiKey = data.apiKey ?? config.android?.config?.branch?.apiKey;
6874
const { testApiKey, enableTestEnvironment = false } = data;
6975

‎packages/react-native-branch/src/withBranchIOS.ts‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,12 @@ export const withBranchIOS: ConfigPlugin<ConfigData> = (config, data) => {
5858
// config. The `branch` property in the Expo Config is deprecated and will be
5959
// removed in SDK 56.
6060
// TODO(@hassankhan): Remove fallback when updating for SDK 56
61+
if (config.ios?.config?.branch?.apiKey) {
62+
console.warn(
63+
"react-native-branch: Using `config.ios.config.branch.apiKey` is deprecated. " +
64+
"Pass `apiKey` directly in the plugin config instead.",
65+
);
66+
}
6167
const apiKey = data.apiKey ?? config.ios?.config?.branch?.apiKey;
6268
const { testApiKey, enableTestEnvironment = false } = data;
6369

0 commit comments

Comments
 (0)