-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathapp.config.ts
More file actions
213 lines (204 loc) · 6.63 KB
/
Copy pathapp.config.ts
File metadata and controls
213 lines (204 loc) · 6.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
import type { ExpoConfig } from 'expo/config';
const INTERCOM_REGIONS = ['US', 'EU', 'AU'] as const;
type IntercomRegion = (typeof INTERCOM_REGIONS)[number];
function resolveIntercomRegion(): IntercomRegion {
const raw = process.env.INTERCOM_REGION;
if (!raw) return 'US';
if ((INTERCOM_REGIONS as readonly string[]).includes(raw)) {
return raw as IntercomRegion;
}
console.warn(
`[intercom] invalid INTERCOM_REGION "${raw}" — expected one of ${INTERCOM_REGIONS.join(', ')}; defaulting to US.`
);
return 'US';
}
const intercomEnv = {
appId: process.env.INTERCOM_APP_ID,
iosApiKey: process.env.INTERCOM_IOS_API_KEY,
androidApiKey: process.env.INTERCOM_ANDROID_API_KEY,
region: resolveIntercomRegion(),
};
const intercomPlugin: NonNullable<ExpoConfig['plugins']>[number] | null =
intercomEnv.appId && intercomEnv.iosApiKey && intercomEnv.androidApiKey
? [
'@intercom/intercom-react-native',
{
appId: intercomEnv.appId,
iosApiKey: intercomEnv.iosApiKey,
androidApiKey: intercomEnv.androidApiKey,
intercomRegion: intercomEnv.region,
},
]
: null;
if (!intercomPlugin) {
console.warn(
'[intercom] INTERCOM_APP_ID / INTERCOM_IOS_API_KEY / INTERCOM_ANDROID_API_KEY missing — Intercom plugin disabled in this build.'
);
}
// RevenueCat (in-app purchases) public SDK keys, surfaced to the runtime via
// `extra` so the iap-bridge can read the platform-appropriate key. No native
// config plugin is required — `react-native-purchases` autolinks on prebuild.
const revenueCatEnv = {
iosApiKey: process.env.REVENUECAT_IOS_API_KEY,
androidApiKey: process.env.REVENUECAT_ANDROID_API_KEY,
};
if (!revenueCatEnv.iosApiKey && !revenueCatEnv.androidApiKey) {
console.warn(
'[iap] REVENUECAT_IOS_API_KEY / REVENUECAT_ANDROID_API_KEY missing — in-app purchases disabled in this build.'
);
}
const config: ExpoConfig = {
name: '3ook.com',
owner: 'likerland',
slug: '3ook-com-app',
version: '1.3.3',
// Portrait by default; iOS frees iPad via UISupportedInterfaceOrientations~ipad
// and services/orientation unlocks Android sw600dp+ at runtime. Keep
// expo-screen-orientation out of `plugins`: one mask would flatten that split.
orientation: 'portrait',
icon: './assets/images/icon.png',
scheme: 'com.3ook',
userInterfaceStyle: 'automatic',
// iOS picks the first preferred language with a matching .lproj, so Chinese
// needs its own locale file — otherwise a zh device with en in its list
// falls through to en.json instead of the Chinese base name.
locales: {
en: './locales/en.json',
'zh-Hant': './locales/zh-Hant.json',
'zh-Hans': './locales/zh-Hans.json',
},
ios: {
supportsTablet: true,
bundleIdentifier: 'land.liker.book3app',
googleServicesFile: './GoogleService-Info.plist',
associatedDomains: ['applinks:3ook.com', 'webcredentials:3ook.com'],
infoPlist: {
CFBundleDisplayName: '3ook.com',
CFBundleAllowMixedLocalizations: true,
ITSAppUsesNonExemptEncryption: false,
IntercomUniversalLinkDomains: ['3ook.com'],
NSMicrophoneUsageDescription:
'This app uses your microphone to record your voice and create a custom voice for the text-to-speech feature.',
NSCameraUsageDescription:
'This app uses the camera to take a profile photo and capture photos for customer service requests.',
// No app code saves photos — this is WKWebView's own image context menu
// ("Add to Photos"). Without the key iOS crashes instead of denying it.
NSPhotoLibraryAddUsageDescription:
'This app saves images you choose to save to your photo library.',
NSAppTransportSecurity: {
NSAllowsLocalNetworking: true,
NSAllowsArbitraryLoadsForMedia: true,
},
UIBackgroundModes: ['remote-notification'],
},
},
android: {
googleServicesFile: './google-services.json',
package: 'land.liker.book3app',
permissions: [
'android.permission.WAKE_LOCK',
'android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS',
],
adaptiveIcon: {
backgroundColor: '#131313',
foregroundImage: './assets/images/android-icon-foreground.png',
backgroundImage: './assets/images/android-icon-background.png',
monochromeImage: './assets/images/android-icon-monochrome.png',
},
predictiveBackGestureEnabled: false,
intentFilters: [
{
action: 'VIEW',
autoVerify: true,
data: [
{
scheme: 'https',
host: '3ook.com',
},
],
category: ['BROWSABLE', 'DEFAULT'],
},
],
},
web: {
output: 'static',
favicon: './assets/images/favicon.png',
},
plugins: [
'expo-router',
[
'expo-splash-screen',
{
image: './assets/images/splash-icon.png',
imageWidth: 200,
resizeMode: 'contain',
backgroundColor: '#131313',
dark: {
backgroundColor: '#131313',
},
},
],
[
'@sentry/react-native/expo',
{
url: 'https://sentry.io/',
project: '3ook-com-app',
organization: 'likerland-team',
},
],
[
'expo-audio',
{
enableBackgroundPlayback: true,
},
],
'expo-font',
'expo-image',
'expo-web-browser',
'expo-asset',
'expo-localization',
[
'expo-build-properties',
{
ios: {
useFrameworks: 'static',
forceStaticLinking: ['RNFBApp', 'RNFBAnalytics', 'RNFBCrashlytics'],
ccacheEnabled: true,
},
android: {
buildArchs: ['armeabi-v7a', 'arm64-v8a'],
},
},
],
'@react-native-firebase/app',
// Sentry is the source of truth for JS errors; disable Crashlytics' JS
// error generation so we don't get duplicate non-fatals. Native crashes
// are still captured by Crashlytics regardless.
[
'@react-native-firebase/crashlytics',
{
crashlytics_is_error_generation_on_js_crash_enabled: false,
},
],
'expo-sharing',
'./plugins/withAppBoundDomains',
// Intercom must precede any plugin that registers its own
// FirebaseMessagingService (e.g. expo-notifications). Intercom's
// auto-generated service routes Intercom pushes to the SDK and forwards
// everything else; flipping the order shadows Intercom's handler.
...(intercomPlugin ? [intercomPlugin] : []),
'expo-notifications',
],
experiments: {
typedRoutes: true,
reactCompiler: true,
},
extra: {
router: {},
eas: {
projectId: 'b9b3551b-65fa-4f8e-b570-2bbb220b971b',
},
revenueCat: revenueCatEnv,
},
};
export default config;