Skip to content

Commit

Permalink
feat: added android eas configs
Browse files Browse the repository at this point in the history
  • Loading branch information
usotsukki committed Oct 18, 2024
1 parent 7602742 commit 795d644
Show file tree
Hide file tree
Showing 14 changed files with 51 additions and 14 deletions.
5 changes: 5 additions & 0 deletions .easignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ node_modules/
dist/
web-build/
expo-env.d.ts
credentials/
credentials.json

# Native
*.orig.*
Expand All @@ -14,6 +16,7 @@ expo-env.d.ts
*.p12
*.key
*.mobileprovision
*.keystore

# Metro
.metro-health-check*
Expand Down Expand Up @@ -44,9 +47,11 @@ build-*.tar.gz

# Firebase
GoogleService-Info.plist
google-services.json

# Archives
build-*.tar.gz
build-*.apk

# Tests
__tests__/
Expand Down
7 changes: 4 additions & 3 deletions .env.public
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
NODE_ENV=development
EXPO_PUBLIC_NODE_ENV=development
EXPO_PUBLIC_ENABLE_DEV_MODE=true
EXPO_PUBLIC_IS_TESTING=false
EXPO_PUBLIC_LOG_DEBUG=false
EXPO_PUBLIC_LOG_LEVEL=debug
EXPO_PUBLIC_SENTRY_DSN=https://6bf30b84d315b016b9529662b5f11182@o4505033974284288.ingest.us.sentry.io/4508070604374016
EXPO_PUBLIC_SENTRY_DSN=https://6bf30b84d315b016b9529662b5f11182@o4505033974284288.ingest.us.sentry.io/4508070604374016
EXPO_PUBLIC_GOOGLE_WEB_CLIENT_ID=762459437378-v3tsf9qvlfmvftirgt3sllj5p1rpi1lp.apps.googleusercontent.com
EXPO_PUBLIC_GOOGLE_IOS_CLIENT_ID=333850807930-ij59g3k6p4pslnus2elrm5egkgju61e3.apps.googleusercontent.com
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ node_modules/
dist/
web-build/
expo-env.d.ts
credentials/
credentials.json

# Native
*.orig.*
Expand All @@ -14,6 +16,7 @@ expo-env.d.ts
*.p12
*.key
*.mobileprovision
*.keystore

# Metro
.metro-health-check*
Expand All @@ -39,11 +42,14 @@ ios
android

.eslintcache

# Archives
build-*.tar.gz
build-*.apk

# Firebase
GoogleService-Info.plist
google-services.json

# Dev
cpd
6 changes: 6 additions & 0 deletions app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,16 @@ export default ({ config: initConfig }: ConfigContext): ExpoConfig => {
googleServicesFile: process.env.GOOGLE_SERVICE_FILE_IOS || './GoogleService-Info.plist',
config: {
googleMapsApiKey: process.env.GOOGLE_MAPS_API_KEY_IOS,
usesNonExemptEncryption: false,
},
},
android: {
...initConfig.android,
package: bundleIdentifier,
googleServicesFile: process.env.GOOGLE_SERVICE_FILE_ANDROID || './google-services.json',
config: {
googleMaps: { apiKey: process.env.GOOGLE_MAPS_API_KEY_ANDROID },
},
},
updates: {
url: 'https://u.expo.dev/6afd57d1-5bac-48fc-b3f3-40a510289ae2',
Expand Down
6 changes: 5 additions & 1 deletion eas.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,13 @@
"ios": {
"simulator": true
},
"android": {
"buildType": "apk"
},
"env": {
"NODE_ENV": "development",
"EXPO_PUBLIC_NODE_ENV": "development"
"EXPO_PUBLIC_NODE_ENV": "development",
"EXPO_PUBLIC_GOOGLE_WEB_CLIENT_ID": "762459437378-v3tsf9qvlfmvftirgt3sllj5p1rpi1lp.apps.googleusercontent.com"
}
},
"production": {
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
"main": "expo-router/entry",
"scripts": {
"android": "yarn expo run:android -d",
"eas-android": "eas build -p android -e development",
"eas-ios": "eas build -p ios -e development",
"eas-run-android": "eas build:run --latest -p android -e development",
"eas-run-ios": "eas build:run --latest -p ios -e development",
"check-deps": "./scripts/check-unused-deps.sh",
"check-duplicates": "yarn jscpd --config jscpd.json",
Expand Down Expand Up @@ -56,6 +58,7 @@
"expo": "~51.0.38",
"expo-apple-authentication": "~6.4.2",
"expo-application": "~5.9.1",
"expo-blur": "~13.0.2",
"expo-build-properties": "~0.12.5",
"expo-constants": "~16.0.2",
"expo-dev-client": "~4.0.28",
Expand Down
1 change: 1 addition & 0 deletions src/app/(tabs)/_layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const TabLayout = () => {
<ErrorBoundary fallbackRender={renderFallback} onReset={onReset}>
<Tabs
sceneContainerStyle={{ backgroundColor: Colors.grayBlack }}
detachInactiveScreens={false}
screenOptions={{
tabBarTestID: 'TabBar',
headerShown: false,
Expand Down
6 changes: 4 additions & 2 deletions src/app/_layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import * as SplashScreen from 'expo-splash-screen'
import { useEffect } from 'react'
import { SafeAreaProvider } from 'react-native-safe-area-context'
import { NetInfoToast, Toast } from '@app/components'
import { IS_PROD, SENTRY_DEBUG, SENTRY_DSN } from '@app/env'
import { GOOGLE_WEB_CLIENT_ID, IS_PROD, SENTRY_DEBUG, SENTRY_DSN } from '@app/env'
import { useLoadFonts } from '@app/hooks'
import { useStorageDevTools } from '@app/storage'
import '@app/theme'
Expand Down Expand Up @@ -45,7 +45,9 @@ const RootLayout = () => {

SplashScreen.hideAsync()
routingInstrumentation.registerNavigationContainer(ref)
GoogleSignin.configure()
GoogleSignin.configure({
webClientId: GOOGLE_WEB_CLIENT_ID,
})
GoogleSignin.hasPlayServices()

return unsubscribe
Expand Down
5 changes: 0 additions & 5 deletions src/app/index.tsx

This file was deleted.

2 changes: 2 additions & 0 deletions src/env/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,5 @@ export const SENTRY_DEBUG = !IS_PROD && false
export const TRANSLATIONS_DEBUG = !IS_PROD && false

export const SENTRY_DSN = process.env.EXPO_PUBLIC_SENTRY_DSN

export const GOOGLE_WEB_CLIENT_ID = process.env.EXPO_PUBLIC_GOOGLE_WEB_CLIENT_ID
3 changes: 2 additions & 1 deletion src/hooks/useAuth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ const useAuth = () => {
}

useEffect(() => {
auth().onAuthStateChanged(setUser)
const unsubscribe = auth().onAuthStateChanged(setUser)
return unsubscribe
}, [])

const getGoogleAuthCredential = async () => {
Expand Down
3 changes: 2 additions & 1 deletion src/screens/Welcome/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { useRouter } from 'expo-router'
import { useTranslation } from 'react-i18next'
import { Colors, Text, View } from 'react-native-ui-lib'
import { LoaderModal, Logo, SignInButton, SwitchLanguageButton } from '@app/components'
import { IS_IOS } from '@app/env'
import { useAuth } from '@app/hooks'

const Welcome = () => {
Expand All @@ -25,7 +26,7 @@ const Welcome = () => {
<View gap-s3>
<SignInButton onPress={navigateToSignIn} testID="Welcome.SignIn" />
<SignInButton onPress={signInWithGoogle} authProvider="google" testID="Welcome.GoogleSignIn" />
<SignInButton onPress={signInWithApple} authProvider="apple" testID="Welcome.AppleSignIn" />
{IS_IOS && <SignInButton onPress={signInWithApple} authProvider="apple" testID="Welcome.AppleSignIn" />}
<Text white center>
{i18n.t('or')}
</Text>
Expand Down
7 changes: 6 additions & 1 deletion src/utils/navigation/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,14 @@ export const stackHeaderScreenOptions = {
headerTitleStyle: [
{
color: Colors.black,
...headingSizes['26px / 30px'],
...headingSizes['23px / 27px'],
...fonts.SFProRounded.bold,
},
],
headerLeft: () => <HeaderBackButton />,
headerTitleAlign: 'center' as 'center' | 'left' | undefined,
headerTitleContainerStyle: {
borderWidth: 1,
paddingHorizontal: 30,
},
}
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7942,6 +7942,11 @@ expo-asset@~10.0.10:
invariant "^2.2.4"
md5-file "^3.2.3"

expo-blur@~13.0.2:
version "13.0.2"
resolved "https://registry.yarnpkg.com/expo-blur/-/expo-blur-13.0.2.tgz#c2d179b19b13830db1d8b90c51373235f462e958"
integrity sha512-t2p7BChO3Reykued++QJRMZ/og6J3aXtSQ+bU31YcBeXhZLkHwjWEhiPKPnJka7J2/yTs4+jOCNDY0kCZmcE3w==

expo-build-properties@~0.12.5:
version "0.12.5"
resolved "https://registry.yarnpkg.com/expo-build-properties/-/expo-build-properties-0.12.5.tgz#4d6232389f00c846ba37ca5df2c0b5527c2d94ca"
Expand Down

0 comments on commit 795d644

Please sign in to comment.