194 lines
5.5 KiB
JavaScript
194 lines
5.5 KiB
JavaScript
export const PROJECT_ID = 'c951a6a3-e1d8-4e39-8636-c476da1fe5be'
|
||
export const APPNAME = 'duooomi'
|
||
export const EXPO_PROJECT = 'duooomi'
|
||
export const SCHEME = 'duooomi'
|
||
export const EXPO_OWER = 'bowong'
|
||
export const ANDROID_ID = 'com.duomi.duooomi'
|
||
export const IOS_ID = ANDROID_ID
|
||
export const IOS_UNIVERSAL_LINK = 'duooomi.bowong.cn'
|
||
|
||
// 原生版本,原生代码变更时需要更新此版本号
|
||
export const VERSION = '1.1.0'
|
||
// JavaScript版本,JS代码变更时需要更新此版本号
|
||
export const APP_VERSION = 'dev202601191538'
|
||
|
||
const ALIPAY_SCHEMA = 'alipay2021006119657394'
|
||
const ALIPAY_SCHEMA_SANDBOX = 'alipay9021000158673972'
|
||
|
||
export const CNDHOST = 'https://cdn.roasmax.cn/'
|
||
|
||
console.log('process.env.APP_ENV---dev', process.env.EXPO_PUBLIC_ENV)
|
||
|
||
export default ({ config }) => {
|
||
return {
|
||
...config,
|
||
expo: {
|
||
name: APPNAME,
|
||
slug: EXPO_PROJECT,
|
||
version: VERSION,
|
||
orientation: 'portrait',
|
||
icon: './assets/images/icon.png',
|
||
scheme: SCHEME,
|
||
userInterfaceStyle: 'automatic',
|
||
owner: EXPO_OWER,
|
||
newArchEnabled: true,
|
||
|
||
ios: {
|
||
supportsTablet: true,
|
||
infoPlist: {
|
||
NSBluetoothPeripheralUsageDescription:
|
||
'This app uses Bluetooth to act as a peripheral device for testing and development purposes.',
|
||
CFBundleURLTypes: [
|
||
{
|
||
CFBundleURLSchemes: [SCHEME],
|
||
LSApplicationQueriesSchemes: ['alipay'],
|
||
},
|
||
],
|
||
},
|
||
bundleIdentifier: IOS_ID,
|
||
associatedDomains: [`applinks:${IOS_UNIVERSAL_LINK}`],
|
||
},
|
||
|
||
android: {
|
||
adaptiveIcon: {
|
||
backgroundColor: '#E6F4FE',
|
||
foregroundImage: './assets/images/android-icon-foreground.png',
|
||
backgroundImage: './assets/images/android-icon-background.png',
|
||
monochromeImage: './assets/images/android-icon-monochrome.png',
|
||
},
|
||
edgeToEdgeEnabled: true,
|
||
predictiveBackGestureEnabled: false,
|
||
forceDarkAllowed: false,
|
||
|
||
// 已去重的权限
|
||
permissions: [
|
||
'android.permission.INTERNET',
|
||
'android.permission.BLUETOOTH',
|
||
'android.permission.BLUETOOTH_ADMIN',
|
||
'android.permission.BLUETOOTH_SCAN',
|
||
'android.permission.BLUETOOTH_CONNECT',
|
||
'android.permission.BLUETOOTH_ADVERTISE',
|
||
'android.permission.ACCESS_FINE_LOCATION',
|
||
'android.permission.READ_EXTERNAL_STORAGE',
|
||
'android.permission.WRITE_EXTERNAL_STORAGE',
|
||
'android.permission.READ_MEDIA_VISUAL_USER_SELECTED',
|
||
'android.permission.ACCESS_MEDIA_LOCATION',
|
||
'android.permission.READ_MEDIA_IMAGES',
|
||
'android.permission.READ_MEDIA_VIDEO',
|
||
'android.permission.READ_MEDIA_AUDIO',
|
||
'android.permission.RECORD_AUDIO',
|
||
],
|
||
|
||
package: ANDROID_ID,
|
||
},
|
||
|
||
web: {
|
||
output: 'static',
|
||
favicon: './assets/images/favicon.png',
|
||
bundler: 'metro',
|
||
},
|
||
|
||
splash: {
|
||
image: './assets/images/splash-icon.png',
|
||
resizeMode: 'contain',
|
||
backgroundColor: '#000000',
|
||
},
|
||
|
||
plugins: [
|
||
'expo-router',
|
||
'expo-native-alipay',
|
||
'expo-wechat',
|
||
'./plugins/withLargeHeap',
|
||
// ['./plugins/withCmakeVersion', { version: '4.1.2' }],
|
||
|
||
[
|
||
'@sentry/react-native/expo',
|
||
{
|
||
url: 'https://sentry.io/',
|
||
project: 'duooomi',
|
||
organization: 'bowongai',
|
||
},
|
||
],
|
||
|
||
[
|
||
'expo-build-properties',
|
||
{
|
||
ios: {
|
||
useFrameworks: 'static',
|
||
},
|
||
android: {
|
||
// 解决构建打包时webp导致内存占用过高,临时禁用
|
||
enableProguardInReleaseBuilds: false,
|
||
enableShrinkResourcesInReleaseBuilds: false,
|
||
|
||
// 增加 Java 堆内存
|
||
packagingOptions: {
|
||
pickFirst: ['**/libc++_shared.so', '**/libjsc.so'],
|
||
},
|
||
// 设置 JVM 参数
|
||
jvmArgs: ['-Xmx4096m', '-XX:MaxMetaspaceSize=1024m'],
|
||
extraProguardRules: `-keep class com.tencent.mm.opensdk.** {
|
||
*;
|
||
}
|
||
|
||
-keep class com.tencent.wxop.** {
|
||
*;
|
||
}
|
||
|
||
-keep class com.tencent.mm.sdk.** {
|
||
*;
|
||
}`,
|
||
},
|
||
},
|
||
],
|
||
|
||
[
|
||
'react-native-ble-plx',
|
||
{
|
||
isBackgroundEnabled: true,
|
||
modes: ['peripheral', 'central'],
|
||
bluetoothAlwaysPermission: 'Allow $(PRODUCT_NAME) to connect to bluetooth devices',
|
||
},
|
||
],
|
||
[
|
||
'expo-media-library',
|
||
{
|
||
photosPermission: 'Allow $(PRODUCT_NAME) to access your photos.',
|
||
savePhotosPermission: 'Allow $(PRODUCT_NAME) to save photos.',
|
||
isAccessMediaLocationEnabled: true,
|
||
},
|
||
],
|
||
[
|
||
'expo-image-picker',
|
||
{
|
||
photosPermission: 'The app accesses your photos to let you upload your avatar or post images.',
|
||
},
|
||
],
|
||
],
|
||
|
||
experiments: {
|
||
typedRoutes: true,
|
||
reactCompiler: true,
|
||
},
|
||
|
||
extra: {
|
||
router: {},
|
||
eas: {
|
||
projectId: PROJECT_ID,
|
||
},
|
||
},
|
||
|
||
runtimeVersion: {
|
||
policy: 'appVersion',
|
||
},
|
||
|
||
updates: {
|
||
// 后期替换为 cloudflare workers
|
||
url: `https://u.expo.dev/${PROJECT_ID}`,
|
||
fallbackToCacheTimeout: 0,
|
||
checkAutomatically: 'NEVER',
|
||
},
|
||
},
|
||
}
|
||
}
|