expo-duooomi-app/app.config.js

167 lines
4.8 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.

const withCmakeVersion = require('./plugins/withCmakeVersion')
const { PROJECT_ID, VERSION, APPNAME, EXPO_PROJECT, SCHEME, EXPO_OWER, ANDROID_ID, IOS_ID, IOS_UNIVERSAL_LINK } = require('./app.constants')
export const ALIPAY_SCHEMA = 'alipay2021006119657394'
export const ALIPAY_SCHEMA_SANDBOX = 'alipay9021000158673972'
console.log('process.env.APP_ENV---dev', process.env.EXPO_PUBLIC_ENV)
export const APP_VERSION = 'dev202512231154'
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: [ALIPAY_SCHEMA, ALIPAY_SCHEMA_SANDBOX],
},
],
},
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,
// 已去重的权限
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',
[withCmakeVersion, { version: '4.1.2' }],
[
'@sentry/react-native/expo',
{
url: 'https://sentry.io/',
project: 'duooomi',
organization: 'bowongai',
},
],
[
// expo-build-properties是另外一个expo官方的插件它能让你自定义很多构建阶段的参数包括自定义混淆规则和maven仓库等。
// 记得先npx expo install expo-build-properties
'expo-build-properties',
{
android: {
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',
},
},
}
}