@@ -2,7 +2,17 @@ import type { PluginConfigType as BuildPropertiesConfig } from "expo-build-prope
22import type withCamera from "expo-camera/plugin/build/withCamera" ;
33import type { FontProps } from "expo-font/plugin/build/withFonts" ;
44
5- import { AndroidConfig , withAndroidManifest , withAppBuildGradle , type ConfigPlugin } from "expo/config-plugins" ;
5+ import {
6+ AndroidConfig ,
7+ withAndroidManifest ,
8+ withAppBuildGradle ,
9+ withDangerousMod ,
10+ withSettingsGradle ,
11+ withXcodeProject ,
12+ type ConfigPlugin ,
13+ } from "expo/config-plugins" ;
14+ import { copyFileSync , existsSync , mkdirSync } from "node:fs" ;
15+ import path from "node:path" ;
616import { env } from "node:process" ;
717
818import metadata from "./package.json" ;
@@ -13,7 +23,6 @@ import type { withSentry } from "@sentry/react-native/expo";
1323import type { ExpoConfig } from "expo/config" ;
1424import type * as OneSignalPlugin from "onesignal-expo-plugin/types/types" ;
1525
16- const { Mode } = require ( "onesignal-expo-plugin/build/types/types" ) as typeof OneSignalPlugin ; // eslint-disable-line unicorn/prefer-module
1726
1827if ( env . EAS_BUILD_RUNNER === "eas-build" ) env . APP_DOMAIN ??= "web.exactly.app" ;
1928if ( env . APP_DOMAIN ) env . EXPO_PUBLIC_DOMAIN = env . APP_DOMAIN ;
@@ -45,6 +54,7 @@ export default {
4554 associatedDomains : [ `webcredentials:${ env . APP_DOMAIN ?? "sandbox.exactly.app" } ` ] ,
4655 supportsTablet : false ,
4756 buildNumber : String ( versionCode ) ,
57+ entitlements : { "com.apple.developer.payment-pass-provisioning" : true } ,
4858 infoPlist : {
4959 ITSAppUsesNonExemptEncryption : false ,
5060 NSCameraUsageDescription : "This app uses the camera to verify your identity." ,
@@ -110,12 +120,55 @@ export default {
110120 [
111121 "onesignal-expo-plugin" ,
112122 {
113- mode : env . NODE_ENV === "production" ? Mode . Prod : Mode . Dev ,
123+ mode : env . NODE_ENV === "production" ? "production" : "development" ,
114124 smallIcons : [ "src/assets/notifications_default.png" ] ,
115125 largeIcons : [ "src/assets/notifications_default_large.png" ] ,
116126 } satisfies OneSignalPlugin . OneSignalPluginProps ,
117127 ] ,
118128 // @ts -expect-error inline plugin
129+ ( ( config ) => {
130+ const withAndroid = withDangerousMod ( config , [
131+ "android" ,
132+ ( c ) => {
133+ const source = path . join ( c . modRequest . projectRoot , "src/assets/mea_config" ) ;
134+ const destination = path . join ( c . modRequest . projectRoot , "android/app/src/main/assets/mea_config" ) ;
135+ mkdirSync ( path . dirname ( destination ) , { recursive : true } ) ;
136+ if ( existsSync ( source ) ) copyFileSync ( source , destination ) ;
137+ return c ;
138+ } ,
139+ ] ) ;
140+ return withXcodeProject ( withAndroid , ( c ) => {
141+ const source = path . join ( c . modRequest . projectRoot , "src/assets/mea_config" ) ;
142+ const destination = path . join ( c . modRequest . projectRoot , "ios" , c . modRequest . projectName ?? "" , "mea_config" ) ;
143+ if ( existsSync ( source ) ) copyFileSync ( source , destination ) ;
144+ // eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access
145+ c . modResults . addResourceFile (
146+ "mea_config" ,
147+ { target : c . modResults . getFirstTarget ( ) . uuid } , // eslint-disable-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access
148+ c . modRequest . projectName ?? "" ,
149+ ) ;
150+ return c ;
151+ } ) ;
152+ } ) satisfies ConfigPlugin ,
153+ // @ts -expect-error inline plugin
154+ ( ( config ) =>
155+ withSettingsGradle ( config , ( c ) => {
156+ const meaRepo = `maven {
157+ url "https://nexus.ext.meawallet.com/repository/mpp-android-group/"
158+ credentials {
159+ username = "${ env . MEAWALLET_ANDROID_USER } "
160+ password = "${ env . MEAWALLET_ANDROID_PASS } "
161+ }
162+ }` ;
163+ if ( ! c . modResults . contents . includes ( "nexus.ext.meawallet.com" ) ) {
164+ c . modResults . contents = c . modResults . contents . replace (
165+ / d e p e n d e n c y R e s o l u t i o n M a n a g e m e n t \s * \{ [ ^ } ] * r e p o s i t o r i e s \s * \{ / ,
166+ `$&\n ${ meaRepo } ` ,
167+ ) ;
168+ }
169+ return c ;
170+ } ) ) satisfies ConfigPlugin ,
171+ // @ts -expect-error inline plugin
119172 ( ( config ) =>
120173 withAndroidManifest (
121174 withAppBuildGradle ( config , ( c ) => {
0 commit comments