Skip to content

Commit 565387d

Browse files
committed
keep class BuildConfig
1 parent 732975c commit 565387d

5 files changed

Lines changed: 18 additions & 6 deletions

File tree

sample/android/app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ android {
8585
applicationId "com.shopify.checkoutkitreactnative"
8686
minSdkVersion rootProject.ext.minSdkVersion
8787
targetSdkVersion rootProject.ext.targetSdkVersion
88-
versionCode 10
88+
versionCode 11
8989
versionName "1.1"
9090
}
9191
signingConfigs {

sample/android/app/proguard-rules.pro

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@
88
# http://developer.android.com/guide/developing/tools/proguard.html
99

1010
# Add any project specific keep options here:
11+
-keep class com.shopify.checkoutkitreactnative.BuildConfig { *; }

sample/src/App.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import {
3333
import {createBottomTabNavigator} from '@react-navigation/bottom-tabs';
3434
import {createNativeStackNavigator} from '@react-navigation/native-stack';
3535
import {ApolloClient, InMemoryCache, ApolloProvider} from '@apollo/client';
36-
import env from 'react-native-config';
36+
import Config from 'react-native-config';
3737
import Icon from 'react-native-vector-icons/Entypo';
3838

3939
import CatalogScreen from './screens/CatalogScreen';
@@ -94,11 +94,11 @@ const Stack = createNativeStackNavigator<RootStackParamList>();
9494
export const cache = new InMemoryCache();
9595

9696
const client = new ApolloClient({
97-
uri: `https://${env.STOREFRONT_DOMAIN}/api/${env.STOREFRONT_VERSION}/graphql.json`,
97+
uri: `https://${Config.STOREFRONT_DOMAIN}/api/${Config.STOREFRONT_VERSION}/graphql.json`,
9898
cache,
9999
headers: {
100100
'Content-Type': 'application/json',
101-
'X-Shopify-Storefront-Access-Token': env.STOREFRONT_ACCESS_TOKEN ?? '',
101+
'X-Shopify-Storefront-Access-Token': Config.STOREFRONT_ACCESS_TOKEN ?? '',
102102
},
103103
connectToDevTools: true,
104104
});

sample/src/screens/SettingsScreen.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ import {
3333
View,
3434
} from 'react-native';
3535
import pkg from '../../../package.json';
36+
import Config from 'react-native-config';
3637
import {useConfig} from '../context/Config';
3738
import {
3839
ColorScheme,
@@ -220,6 +221,16 @@ function SettingsScreen() {
220221
type: SectionType.Text,
221222
value: pkg.version,
222223
},
224+
{
225+
title: 'Storefront Domain',
226+
type: SectionType.Text,
227+
value: Config.STOREFRONT_DOMAIN || 'undefined',
228+
},
229+
{
230+
title: 'Storefront Access Token (last 4)',
231+
type: SectionType.Text,
232+
value: Config.STOREFRONT_ACCESS_TOKEN?.slice(-4) || 'undefined',
233+
},
223234
],
224235
[ShopifyCheckout.version],
225236
);

sample/src/utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import env from 'react-native-config';
1+
import Config from 'react-native-config';
22
import {NativeModules, Platform} from 'react-native';
33
import type {AppConfig} from './context/Config';
44

@@ -14,7 +14,7 @@ const {
1414
PROVINCE,
1515
ZIP,
1616
PHONE,
17-
} = env;
17+
} = Config;
1818

1919
export function createBuyerIdentityCartInput(appConfig: AppConfig) {
2020
if (!appConfig.prefillBuyerInformation) {

0 commit comments

Comments
 (0)