Files
frontend/app.json
lafay 6f84e17772 feat(service): add foreground service for background message sync
Implement Android foreground service to keep app alive in background for real-time message sync:
- Add withForegroundService expo config plugin for notification channel setup
- Add BackgroundSyncManager with REALTIME, BATTERY_SAVER, and DISABLED modes
- Add ForegroundServiceModule for native Android foreground service binding
- Refactor backgroundService to integrate foreground service and expo-background-task

Also refactor auth and profile screens to use dynamic theme colors:
- Replace hardcoded THEME_COLORS with colors.primary.main, colors.background.paper, etc.
- Add useResolvedColorScheme for dynamic StatusBar styling
- Update NotificationSettingsScreen with sync mode selection UI

BREAKING CHANGE: Switched from expo-background-fetch to expo-background-task, minimum background sync interval changed from 900s to 15min in config
2026-04-11 04:27:22 +08:00

152 lines
4.3 KiB
JSON

{
"expo": {
"name": "萝卜社区",
"slug": "qojo",
"version": "1.0.13",
"orientation": "default",
"icon": "./assets/icon.png",
"userInterfaceStyle": "automatic",
"scheme": "carrotbbs",
"splash": {
"image": "./assets/splash-icon.png",
"resizeMode": "contain",
"backgroundColor": "#ffffff"
},
"ios": {
"supportsTablet": true,
"infoPlist": {
"NSMicrophoneUsageDescription": "允许萝卜社区访问您的麦克风以进行语音通话",
"UIBackgroundModes": [
"fetch",
"remote-notification",
"fetch",
"remote-notification",
"audio"
],
"ITSAppUsesNonExemptEncryption": false
},
"bundleIdentifier": "skin.carrot.bbs"
},
"android": {
"adaptiveIcon": {
"backgroundColor": "#E6F4FE",
"foregroundImage": "./assets/android-icon-foreground.png",
"backgroundImage": "./assets/android-icon-background.png",
"monochromeImage": "./assets/android-icon-monochrome.png"
},
"predictiveBackGestureEnabled": false,
"package": "skin.carrot.bbs",
"versionCode": 7,
"permissions": [
"VIBRATE",
"RECORD_AUDIO",
"RECEIVE_BOOT_COMPLETED",
"WAKE_LOCK",
"READ_EXTERNAL_STORAGE",
"WRITE_EXTERNAL_STORAGE",
"READ_MEDIA_IMAGES",
"READ_MEDIA_VIDEO",
"READ_MEDIA_AUDIO",
"android.permission.RECEIVE_BOOT_COMPLETED",
"android.permission.WAKE_LOCK",
"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"
]
},
"web": {
"favicon": "./assets/favicon.png"
},
"plugins": [
"./plugins/withMainActivityConfigChange",
[
"./plugins/withForegroundService",
{
"notificationTitle": "萝卜社区",
"notificationBody": "正在后台同步消息",
"notificationIcon": "ic_notification",
"channelId": "carrot_sync_foreground",
"channelName": "消息同步"
}
],
[
"expo-router",
{
"headers": {
"Cross-Origin-Embedder-Policy": "credentialless",
"Cross-Origin-Opener-Policy": "same-origin"
}
}
],
"expo-sqlite",
[
"expo-camera",
{
"cameraPermission": "允许萝卜社区访问您的相机以扫描二维码"
}
],
[
"expo-notifications",
{
"sounds": []
}
],
[
"expo-background-task",
{
"minimumInterval": 15
}
],
[
"expo-media-library",
{
"photosPermission": "允许萝卜社区访问您的照片以发布内容",
"savePhotosPermission": "允许萝卜社区保存照片到您的相册",
"isAccessMediaLocationEnabled": true
}
],
[
"expo-image-picker",
{
"photosPermission": "允许萝卜社区访问您的照片以选择图片",
"cameraPermission": "允许萝卜社区访问您的相机以拍摄图片",
"colors": {
"cropToolbarColor": "#111827",
"cropToolbarIconColor": "#ffffff",
"cropToolbarActionTextColor": "#ffffff",
"cropBackButtonIconColor": "#ffffff",
"cropBackgroundColor": "#f3f4f6"
},
"dark": {
"colors": {
"cropToolbarColor": "#000000",
"cropToolbarIconColor": "#ffffff",
"cropToolbarActionTextColor": "#ffffff",
"cropBackButtonIconColor": "#ffffff",
"cropBackgroundColor": "#0a0a0a"
}
}
}
],
[
"expo-video",
{
"proguardRules": "-keep class com.google.android.exoplayer2.** { *; }"
}
],
"expo-font"
],
"jsEngine": "hermes",
"extra": {
"eas": {
"projectId": "65540196-d37d-437b-8496-227df0317069"
}
},
"owner": "qojo"
}
}