Skip to content

Commit

Permalink
android emu specific url
Browse files Browse the repository at this point in the history
  • Loading branch information
jdivock-stripe committed Feb 1, 2022
1 parent 35b0ca1 commit eb447fb
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
6 changes: 6 additions & 0 deletions example/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,9 @@ STRIPE_PRIVATE_KEY=sk_test_xxx

# Backend API URL
API_URL=http://127.0.0.1:3002

# Android Backend API URL.
# The example app will default to API_URL if no specific API_URL_ANDROID is defined
# This is helpful when you're working with the android emulator as it remaps the localhost
# ip value (default is 10.0.2.2)
API_URL_ANDROID=http://10.0.2.2:3002
6 changes: 4 additions & 2 deletions example/src/Config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// @ts-ignore
import { API_URL as url } from '@env';
import { API_URL as defaultURL, API_URL_ANDROID as androidURL } from '@env';
import { Platform } from 'react-native';

export const API_URL: string = url;
export const API_URL: string =
Platform.OS === 'android' && androidURL ? androidURL : defaultURL;
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
"e2e:test:ios": "detox test --configuration ios --take-screenshots failing --loglevel verbose",
"e2e:build:android:release": "detox build --configuration android.emu.release",
"e2e:build:ios:release": "detox build --configuration ios.sim.release",
"e2e:test:android:release": "./scripts/startExampleBackendCI.sh && yarn get:testbutler && detox test --configuration android.emu.release --headless --take-screenshots failing --record-logs all",
"e2e:test:ios:release": "./scrpts/startExampleBackendCI.sh && detox test --configuration ios.sim.release --take-screenshots failing",
"e2e:test:android:release": "yarn --cwd example start:server:ci && yarn get:testbutler && detox test --configuration android.emu.release --headless --take-screenshots failing --record-logs all",
"e2e:test:ios:release": "yarn --cwd example start:server:ci && detox test --configuration ios.sim.release --take-screenshots failing",
"get:testbutler": "curl -f -o ./test-butler-app.apk https://repo1.maven.org/maven2/com/linkedin/testbutler/test-butler-app/2.2.1/test-butler-app-2.2.1.apk",
"docs": "npx typedoc ./src/index.tsx --out ./docs/api-reference --tsconfig ./tsconfig.json --theme minimal --theme ./docs/stripe-theme"
},
Expand Down
5 changes: 0 additions & 5 deletions scripts/startExampleBackendCI.sh

This file was deleted.

0 comments on commit eb447fb

Please sign in to comment.