app.config.ts 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263
  1. import 'dotenv/config';
  2. import path from 'path';
  3. import dotenv from 'dotenv';
  4. import type { ConfigContext, ExpoConfig } from 'expo/config';
  5. const env = process.env;
  6. const API_HOST = env.ENV === 'production' ? env.PRODUCTION_API_HOST : env.DEVELOPMENT_API_HOST;
  7. const MAP_HOST = env.ENV === 'production' ? env.PRODUCTION_MAP_HOST : env.DEVELOPMENT_MAP_HOST;
  8. const NM_API_HOST = env.NM_API_HOST;
  9. const GOOGLE_MAP_PLACES_APIKEY = env.GOOGLE_MAP_PLACES_APIKEY;
  10. const WEBSOCKET_URL =
  11. env.ENV === 'production' ? env.PRODUCTION_WEBSOCKET_URL : env.DEVELOPMENT_WEBSOCKET_URL;
  12. dotenv.config({
  13. path: path.resolve(process.cwd(), '.env')
  14. });
  15. export default ({ config }: ConfigContext): ExpoConfig => ({
  16. ...config,
  17. name: 'NomadMania',
  18. slug: 'nomadmania-app',
  19. owner: 'nomadmaniaou',
  20. scheme: 'nm',
  21. // Should be updated after every production release (deploy to AppStore/PlayMarket)
  22. version: '2.0.52',
  23. // Should be updated after every dependency change
  24. runtimeVersion: '1.7',
  25. orientation: 'portrait',
  26. icon: './assets/icon-logo.png',
  27. userInterfaceStyle: 'light',
  28. extra: {
  29. ENV: env.ENV,
  30. API_HOST: API_HOST,
  31. MAP_HOST: MAP_HOST,
  32. GOOGLE_MAP_PLACES_APIKEY: GOOGLE_MAP_PLACES_APIKEY,
  33. WEBSOCKET_URL: WEBSOCKET_URL,
  34. VECTOR_MAP_HOST: env.VECTOR_MAP_HOST,
  35. eas: {
  36. projectId: env.EAS_PROJECT_ID
  37. }
  38. },
  39. experiments: {
  40. tsconfigPaths: true
  41. },
  42. splash: {
  43. image: './assets/splash-screen-world.png',
  44. resizeMode: 'cover',
  45. backgroundColor: '#ffffff'
  46. },
  47. androidStatusBar: {
  48. backgroundColor: '#00000000',
  49. translucent: true,
  50. barStyle: 'dark-content'
  51. },
  52. notification: {
  53. icon: './assets/notification-android-icon.png',
  54. color: '#FFFFFF'
  55. },
  56. updates: {
  57. url: 'https://u.expo.dev/c31c6828-3c32-4c7a-aabc-f9b8336b3b66'
  58. },
  59. platforms: ['ios', 'android'],
  60. assetBundlePatterns: ['**/*', 'assets/db/*.db'],
  61. ios: {
  62. supportsTablet: false,
  63. bundleIdentifier: env.PACKAGE_NAME_IOS, // com.nomadmania.app2
  64. config: {
  65. googleMapsApiKey: env.IOS_GOOGLE_MAP_APIKEY
  66. },
  67. associatedDomains: ['applinks:nomadmania.com'],
  68. infoPlist: {
  69. UIBackgroundModes: ['location', 'fetch', 'remote-notification'],
  70. NSLocationAlwaysUsageDescription:
  71. 'NomadMania uses your location in the background so other users see your latest location and regions are marked as visited automatically.',
  72. NSPhotoLibraryUsageDescription:
  73. 'Enable NomadMania.com to access your photo library to upload your profile picture. Any violence, excess of nudity, stolen picture, or scam is forbidden',
  74. NSPhotoLibraryAddUsageDescription:
  75. 'Enable NomadMania.com to access your photo library to upload your profile picture. Any violence, excess of nudity, stolen picture, or scam is forbidden',
  76. NSPushNotificationsDescription:
  77. 'This will allow NomadMania.com to send you notifications. Also you can disable it in app settings',
  78. NSDocumentsFolderUsageDescription:
  79. 'Nomadmania app needs access to the documents folder to select files.',
  80. NSCameraUsageDescription: 'Nomadmania app needs access to the camera to record video.',
  81. NSLocationWhenInUseUsageDescription:
  82. 'NomadMania uses your location to show it to other users and to help mark regions as visited.',
  83. NSLocationAlwaysAndWhenInUseUsageDescription:
  84. 'NomadMania uses your location in the background so other users see your latest location and regions are marked as visited automatically.',
  85. LSApplicationQueriesSchemes: ['comgooglemaps']
  86. },
  87. privacyManifests: {
  88. NSPrivacyAccessedAPITypes: [
  89. {
  90. NSPrivacyAccessedAPIType: 'NSPrivacyAccessedAPICategoryUserDefaults',
  91. NSPrivacyAccessedAPITypeReasons: ['CA92.1']
  92. }
  93. ]
  94. }
  95. },
  96. android: {
  97. package: env.PACKAGE_NAME_ANDROID, // com.nomadmania.presentation
  98. config: {
  99. googleMaps: {
  100. apiKey: env.ANDROID_GOOGLE_MAP_APIKEY
  101. }
  102. },
  103. intentFilters: [
  104. {
  105. action: 'VIEW',
  106. data: [
  107. {
  108. scheme: 'https',
  109. host: 'nomadmania.com',
  110. pathPrefix: '/profile/'
  111. },
  112. {
  113. scheme: 'https',
  114. host: 'nomadmania.com',
  115. pathPrefix: '/event/'
  116. },
  117. {
  118. scheme: 'https',
  119. host: 'nomadmania.com',
  120. pathPrefix: '/map/'
  121. },
  122. {
  123. scheme: 'https',
  124. host: 'nomadmania.com',
  125. pathPrefix: '/messages/'
  126. },
  127. {
  128. scheme: 'https',
  129. host: 'nomadmania.com',
  130. pathPrefix: '/lpi/'
  131. },
  132. {
  133. scheme: 'https',
  134. host: 'nomadmania.com',
  135. pathPrefix: '/master-ranking/'
  136. },
  137. {
  138. scheme: 'https',
  139. host: 'nomadmania.com',
  140. pathPrefix: '/travellers-in-history/'
  141. },
  142. {
  143. scheme: 'https',
  144. host: 'nomadmania.com',
  145. pathPrefix: '/triumphs/'
  146. },
  147. {
  148. scheme: 'https',
  149. host: 'nomadmania.com',
  150. pathPrefix: '/statistics/'
  151. },
  152. {
  153. scheme: 'https',
  154. host: 'nomadmania.com',
  155. pathPrefix: '/in-memoriam/'
  156. },
  157. {
  158. scheme: 'https',
  159. host: 'nomadmania.com',
  160. pathPrefix: '/series-ranking/'
  161. },
  162. {
  163. scheme: 'https',
  164. host: 'nomadmania.com',
  165. pathPrefix: '/un-masters/'
  166. }
  167. ],
  168. category: ['BROWSABLE', 'DEFAULT']
  169. }
  170. ],
  171. googleServicesFile: './google-services.json',
  172. permissions: [
  173. 'ACCESS_BACKGROUND_LOCATION',
  174. 'ACCESS_FINE_LOCATION',
  175. 'ACCESS_COARSE_LOCATION',
  176. 'READ_EXTERNAL_STORAGE',
  177. 'WRITE_EXTERNAL_STORAGE',
  178. 'NOTIFICATIONS',
  179. 'USER_FACING_NOTIFICATIONS',
  180. 'INTERNET',
  181. 'CAMERA',
  182. 'MODIFY_AUDIO_SETTINGS'
  183. ],
  184. splash: {
  185. backgroundColor: '#ffffff',
  186. imageWidth: 200,
  187. image: './assets/icon-logo.png',
  188. resizeMode: 'contain'
  189. },
  190. versionCode: 114 // 2.0.52, last version sent to Google is 113 (2.0.51)
  191. },
  192. plugins: [
  193. [
  194. 'expo-image-picker',
  195. {
  196. photosPermission: 'Allow NomadMania.com access to your photo library to upload photos.',
  197. cameraPermission: 'Allow NomadMania.com access to your camera to upload photos directly.'
  198. }
  199. ],
  200. [
  201. 'expo-build-properties',
  202. {
  203. ios: {
  204. newArchEnabled: true,
  205. deploymentTarget: '15.1'
  206. },
  207. android: {
  208. minSdkVersion: 24,
  209. targetSdkVersion: 36
  210. // kotlinVersion: '1.7.1'
  211. }
  212. }
  213. ],
  214. [
  215. '@sentry/react-native/expo',
  216. {
  217. organization: env.SENTRY_ORG,
  218. note: 'Use SENTRY_AUTH_TOKEN env to authenticate with Sentry.',
  219. project: env.SENTRY_PROJECT,
  220. url: 'https://sentry.io/'
  221. }
  222. ],
  223. [
  224. 'expo-asset',
  225. {
  226. assets: [
  227. './assets/db/nmRegions.db',
  228. './assets/db/darePlaces.db',
  229. './assets/db/nmCountries.db'
  230. ]
  231. }
  232. ],
  233. 'expo-font',
  234. [
  235. 'expo-audio',
  236. {
  237. microphonePermission: 'Allow Nomadmania to access your microphone.'
  238. }
  239. ],
  240. [
  241. 'expo-video',
  242. {
  243. supportsBackgroundPlayback: true,
  244. supportsPictureInPicture: true
  245. }
  246. ],
  247. ['@maplibre/maplibre-react-native'],
  248. [
  249. 'expo-location',
  250. {
  251. isIosBackgroundLocationEnabled: true,
  252. isAndroidBackgroundLocationEnabled: false
  253. }
  254. ],
  255. 'react-native-compressor'
  256. ]
  257. });