Skip to content

Commit

Permalink
[expo] adjust Android
Browse files Browse the repository at this point in the history
**Summary**

- update app.config.js to use adaptive icon for Android.
- specifcy white background for login screen.
- use __DEV__ flag instead of `Constants.executionEnvironment` as the production build does not have the expected value as `standalone`, but have 'bare'.

**Test**

- expo

**Issue**

- #155
  • Loading branch information
yssk22 committed Jan 4, 2025
1 parent 4261224 commit 0a90094
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 6 deletions.
6 changes: 6 additions & 0 deletions expo/app.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const fs = require('fs');
const path = require('path');

const config = require('./app.config.default').expo;
Expand All @@ -11,6 +12,11 @@ module.exports = (_) => {
// set resources located in config/{name}/ directory
config.icon = path.join('config', cfgName, 'icon.png');
config.splash.image = path.join('config', cfgName, 'splash.png');
const adaptiveIcon = path.join('config', cfgName, 'icon-adaptive.png');
if (fs.existsSync(adaptiveIcon)) {
config.android.adaptiveIcon.foregroundImage = adaptiveIcon;
}

config.ios.googleServicesFile = path.join('config', cfgName, 'GoogleService-Info.plist');
config.android.googleServicesFile = path.join('config', cfgName, 'google-services.json');

Expand Down
Binary file added expo/config/dev/icon-adaptive.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified expo/config/dev/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added expo/config/prod/icon-adaptive.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified expo/config/prod/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions expo/features/app/internals/AppRootGuest.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ const styles = StyleSheet.create({
},
container: {
flexGrow: 1,
backgroundColor: 'white',
justifyContent: 'center',
alignItems: 'center'
},
Expand Down
6 changes: 3 additions & 3 deletions expo/features/app/internals/AppUpdateBanner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,15 @@ export default function AppUpdateBanner() {
}
} catch (e: any) {
if (Constants.expoConfig?.extra?.hpapp?.isDev !== true) {
logging.Error('features.app.AppUpdateBanner', 'failed to aa check update', {
logging.Error('features.app.AppUpdateBanner', 'failed to check update', {
error: e.toString()
});
}
if (!unmounted) {
setState({
...state,
bannerText: `failed to check update`,
debugText: e.toString(),
bannerText: null,
debugText: `Failed to check update: ${e.toString()}`,
lastUpdateTimestamp: new Date()
});
}
Expand Down
2 changes: 1 addition & 1 deletion expo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"lint": "yarn eslint ./",
"genscreen": "node ./scripts/genscreen.js",
"build-ios-dev": "HPAPP_CONFIG_NAME=dev ./scripts/eas.sh build --profile dev --platform ios --non-interactive",
"build-android-dev": "HPAPP_CONFIG_NAME=dev ./scripts/eas.sh build --profile dev --platform android --non-interactive --local --output ./build/hpapp-dev.aab",
"build-android-dev": "HPAPP_CONFIG_NAME=dev ./scripts/eas.sh build --profile dev --platform android --non-interactive --local --output ./build/hpapp-dev.apk",
"build-android-beta": "HPAPP_CONFIG_NAME=beta ./scripts/eas.sh build --profile beta --platform android --non-interactive --local --output ./build/hpapp-beta.aab",
"build-android-prod": "HPAPP_CONFIG_NAME=prod ./scripts/eas.sh build --profile prod --platform android --non-interactive --local --output ./build/hpapp-prod.aab",
"update-beta": "HPAPP_CONFIG_NAME=beta ./scripts/eas.sh update --channel beta --message 'testing' --non-interactive",
Expand Down
3 changes: 1 addition & 2 deletions expo/system/firebase/index.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import analytics from '@react-native-firebase/analytics';
import appcheck from '@react-native-firebase/app-check';
import auth, { FirebaseAuthTypes } from '@react-native-firebase/auth';
import Constants from 'expo-constants';
import { useEffect } from 'react';
import { Platform } from 'react-native';

if (Platform.OS !== 'web') {
const provider = appcheck().newReactNativeFirebaseAppCheckProvider();
if (Constants.executionEnvironment === 'bare') {
if (__DEV__) {
// development build is not distributed through the app store so AppCheck provider has to be 'debug'
provider.configure({
apple: {
Expand Down

0 comments on commit 0a90094

Please sign in to comment.