-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathapp.config.ts
More file actions
153 lines (148 loc) · 5.87 KB
/
app.config.ts
File metadata and controls
153 lines (148 loc) · 5.87 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
import type { PluginConfigType as BuildPropertiesConfig } from "expo-build-properties/build/pluginConfig";
import type { FontProps } from "expo-font/plugin/build/withFonts";
import { AndroidConfig, withAndroidManifest, withAppBuildGradle, type ConfigPlugin } from "expo/config-plugins";
import { env } from "node:process";
import metadata from "./package.json";
import versionCode from "./src/generated/versionCode.js";
import type { IntercomPluginProps } from "@intercom/intercom-react-native/lib/typescript/module/expo-plugins/@types";
import type { withSentry } from "@sentry/react-native/expo";
import type { ExpoConfig } from "expo/config";
if (env.EAS_BUILD_RUNNER === "eas-build") env.APP_DOMAIN ??= "web.exactly.app";
if (env.APP_DOMAIN) env.EXPO_PUBLIC_DOMAIN = env.APP_DOMAIN;
env.EXPO_PUBLIC_INTERCOM_APP_ID ??= env.APP_DOMAIN === "web.exactly.app" ? "eknd6y0s" : "pxd0wo85"; // cspell:ignore eknd6y0s
export default {
name: "Exa",
slug: "exactly",
scheme: "exactly",
version: metadata.version,
orientation: "portrait",
android: {
package: "app.exactly",
adaptiveIcon: { foregroundImage: "src/assets/icon-adaptive.png", backgroundColor: "#1D1D1D" },
permissions: ["android.permission.CAMERA"],
userInterfaceStyle: "automatic",
versionCode,
splash: {
backgroundColor: "#FCFCFC",
image: "src/assets/splash.png",
resizeMode: "contain",
dark: { backgroundColor: "#1D1D1D", image: "src/assets/splash-dark.png" },
},
},
ios: {
icon: "src/assets/icon.png",
bundleIdentifier: "app.exactly",
associatedDomains: [`webcredentials:${env.APP_DOMAIN ?? "sandbox.exactly.app"}`],
supportsTablet: false,
buildNumber: String(versionCode),
infoPlist: {
ITSAppUsesNonExemptEncryption: false,
CFBundleAllowMixedLocalizations: true,
NSCameraUsageDescription: "Exa uses the camera to scan QR codes and verify your identity.",
NSLocationWhenInUseUsageDescription: "Exa uses your location to verify your identity.",
},
userInterfaceStyle: "automatic",
splash: {
backgroundColor: "#FCFCFC",
image: "src/assets/splash.png",
resizeMode: "contain",
dark: { backgroundColor: "#1D1D1D", image: "src/assets/splash-dark.png" },
},
},
web: { output: "static", favicon: "src/assets/favicon.png" },
plugins: [
[
"expo-build-properties",
{
android: {
packagingOptions: { pickFirst: ["**/libcrypto.so"] },
extraMavenRepos: ["https://sdk.withpersona.com/android/releases"],
usesCleartextTraffic: env.APP_DOMAIN === "localhost",
},
} satisfies BuildPropertiesConfig,
],
"expo-camera",
[
"expo-font",
{
fonts: [
"src/assets/fonts/SplineSansMono-Medium.otf",
"src/assets/fonts/SplineSans-Regular.otf",
"src/assets/fonts/SplineSans-SemiBold.otf",
],
} satisfies FontProps,
],
"expo-asset",
[
"expo-localization",
{ supportedLocales: ["en", "es", "es-AR", "es-CR", "es-GT", "es-HN", "es-NI", "es-PY", "es-SV", "es-UY", "pt"] },
],
"expo-router",
[
"@intercom/intercom-react-native",
{
appId: env.EXPO_PUBLIC_INTERCOM_APP_ID,
androidApiKey:
env.APP_DOMAIN === "web.exactly.app"
? "android_sdk-d602d62cbdb9e8e0a6f426db847ddc74d2e26090"
: "android_sdk-e98928bdde6eeb08efe3c1a1f683756b98fc1ba1",
iosApiKey:
env.APP_DOMAIN === "web.exactly.app"
? "ios_sdk-ad6831098d9c2d69bd98e92a5ad7a4f030472a92"
: "ios_sdk-53eec69c747965af2ed69c8e0454b381f04feb86",
} satisfies IntercomPluginProps,
],
[
"@sentry/react-native/expo",
{ organization: "exactly", project: "exa" } satisfies Parameters<typeof withSentry>[1],
],
[
"onesignal-expo-plugin",
{
mode: env.NODE_ENV === "production" ? "production" : "development",
smallIcons: ["src/assets/notifications_default.png"],
largeIcons: ["src/assets/notifications_default_large.png"],
},
],
// @ts-expect-error inline plugin
((config) =>
withAndroidManifest(
withAppBuildGradle(config, (c) => {
c.modResults.contents = c.modResults.contents.replace(
/defaultConfig\s*\{/,
'$& ndk { debugSymbolLevel "FULL" }',
);
c.modResults.contents = c.modResults.contents.replace(
/dependencies\s*\{/,
'$&\nimplementation(enforcedPlatform("com.squareup.okhttp3:okhttp-bom:4.12.0"))', // cspell:ignore okhttp
);
return c;
}),
(configWithManifest) => {
const manifest = configWithManifest.modResults;
manifest.manifest.$["xmlns:tools"] ??= "http://schemas.android.com/tools";
const mainApplication = AndroidConfig.Manifest.getMainApplication(manifest);
if (!mainApplication) return configWithManifest;
const META_NAME = "com.google.mlkit.vision.DEPENDENCIES"; // cspell:ignore mlkit
mainApplication["meta-data"] =
mainApplication["meta-data"]?.filter(({ $ }) => $["android:name"] !== META_NAME) ?? [];
mainApplication["meta-data"].push({
$: {
"android:name": META_NAME,
"android:value": "ocr,face,barcode,barcode_ui",
// @ts-expect-error xmlns:tools
"tools:replace": "android:value",
},
});
configWithManifest.modResults = manifest;
return configWithManifest;
},
)) satisfies ConfigPlugin,
],
experiments: { typedRoutes: true },
extra: { eas: { projectId: "06bc0158-d23b-430b-a7e8-802df03c450b" } },
updates: { url: "https://u.expo.dev/06bc0158-d23b-430b-a7e8-802df03c450b" },
runtimeVersion: { policy: "fingerprint" },
owner: "exactly",
locales: { es: "src/i18n/native/es.json", pt: "src/i18n/native/pt.json" },
} satisfies ExpoConfig;