expo-duooomi-app/app.config.js

231 lines
7.1 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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}.ios`
export const IOS_UNIVERSAL_LINK = 'duooomi.bowong.cn'
// 原生版本,原生代码变更时需要更新此版本号
export const VERSION = '1.2.0'
// JavaScript版本JS代码变更时需要更新此版本号
export const APP_VERSION = 'dev202602051033'
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: {
UIViewControllerBasedStatusBarAppearance: false,
NSBluetoothPeripheralUsageDescription:
'This app uses Bluetooth to act as a peripheral device for testing and development purposes.',
CFBundleURLTypes: [
{
CFBundleURLSchemes: [SCHEME],
LSApplicationQueriesSchemes: ['alipay'],
},
],
},
entitlements: {
'com.apple.developer.kernel.extended-virtual-addressing': true,
},
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/withIOSMemoryOptimization',
// ['./plugins/withCmakeVersion', { version: '4.1.2' }],
'expo-iap',
[
'expo-share-intent',
{
iosActivationRules: {
NSExtensionActivationSupportsWebURLWithMaxCount: 0,
NSExtensionActivationSupportsWebPageWithMaxCount: 0,
NSExtensionActivationSupportsImageWithMaxCount: 1,
NSExtensionActivationSupportsMovieWithMaxCount: 0,
NSExtensionActivationSupportsFileWithMaxCount: 0,
NSExtensionActivationSupportsText: true,
},
iosShareExtensionName: `分享到${APPNAME}`,
iosAppGroupIdentifier: `group.${ANDROID_ID}.shareintent`,
androidIntentFilters: ['image/*'],
// androidMultiIntentFilters: ['image/*', 'video/*'],
androidMainActivityAttributes: {
'android:launchMode': 'singleTask',
},
},
],
[
'@sentry/react-native/expo',
{
url: 'https://sentry.io/',
project: 'duooomi',
organization: 'bowongai',
},
],
[
'expo-build-properties',
{
ios: {
useFrameworks: 'static',
},
android: {
// 解决构建打包时webp导致内存占用过高临时禁用
// 测试环境不压缩,会导致 developmentClient 构建失败
enableProguardInReleaseBuilds: false,
enableShrinkResourcesInReleaseBuilds: false,
// 安卓开启http请求在release模式下允许明文流量
usesCleartextTraffic: true,
// 增加 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.',
},
],
[
'expo-camera',
{
cameraPermission: 'Allow $(PRODUCT_NAME) to access your camera',
microphonePermission: 'Allow $(PRODUCT_NAME) to access your microphone',
recordAudioAndroid: true,
},
],
],
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',
channel: 'test',
},
},
}
}