app.config.ts 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  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 GOOGLE_MAP_PLACES_APIKEY = env.GOOGLE_MAP_PLACES_APIKEY;
  9. const WEBSOCKET_URL =
  10. env.ENV === 'production' ? env.PRODUCTION_WEBSOCKET_URL : env.DEVELOPMENT_WEBSOCKET_URL;
  11. dotenv.config({
  12. path: path.resolve(process.cwd(), '.env')
  13. });
  14. export default ({ config }: ConfigContext): ExpoConfig => ({
  15. ...config,
  16. name: 'NomadMania',
  17. slug: 'nomadmania-app',
  18. owner: 'nomadmaniaou',
  19. scheme: 'nm',
  20. // Should be updated after every production release (deploy to AppStore/PlayMarket)
  21. version: '2.0.26',
  22. // Should be updated after every dependency change
  23. runtimeVersion: '1.5',
  24. orientation: 'portrait',
  25. icon: './assets/icon.png',
  26. userInterfaceStyle: 'light',
  27. extra: {
  28. ENV: env.ENV,
  29. API_HOST: API_HOST,
  30. MAP_HOST: MAP_HOST,
  31. GOOGLE_MAP_PLACES_APIKEY: GOOGLE_MAP_PLACES_APIKEY,
  32. WEBSOCKET_URL: WEBSOCKET_URL,
  33. VECTOR_MAP_HOST: env.VECTOR_MAP_HOST,
  34. eas: {
  35. projectId: env.EAS_PROJECT_ID
  36. }
  37. },
  38. experiments: {
  39. tsconfigPaths: true
  40. },
  41. splash: {
  42. image: './assets/loading-screen.png',
  43. resizeMode: 'cover',
  44. backgroundColor: '#ffffff'
  45. },
  46. androidStatusBar: {
  47. backgroundColor: '#00000000',
  48. translucent: true,
  49. barStyle: 'dark-content'
  50. },
  51. notification: {
  52. icon: './assets/notification-android-icon.png',
  53. color: '#FFFFFF'
  54. },
  55. updates: {
  56. url: 'https://u.expo.dev/c31c6828-3c32-4c7a-aabc-f9b8336b3b66'
  57. },
  58. platforms: ['ios', 'android'],
  59. assetBundlePatterns: ['**/*', 'assets/db/*.db'],
  60. ios: {
  61. supportsTablet: false,
  62. bundleIdentifier: env.PACKAGE_NAME_IOS, // com.nomadmania.app2
  63. config: {
  64. googleMapsApiKey: env.IOS_GOOGLE_MAP_APIKEY
  65. },
  66. infoPlist: {
  67. UIBackgroundModes: ['fetch'],
  68. NSLocationAlwaysUsageDescription:
  69. 'Turn on location service to allow NomadMania.com find friends nearby.',
  70. NSPhotoLibraryUsageDescription:
  71. 'Enable NomadMania.com to access your photo library to upload your profile picture. Any violence, excess of nudity, stolen picture, or scam is forbidden',
  72. NSPhotoLibraryAddUsageDescription:
  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. NSPushNotificationsDescription:
  75. 'This will allow NomadMania.com to send you notifications. Also you can disable it in app settings',
  76. NSDocumentsFolderUsageDescription:
  77. 'Nomadmania app needs access to the documents folder to select files.',
  78. NSCameraUsageDescription: 'Nomadmania app needs access to the camera to record video.',
  79. NSLocationWhenInUseUsageDescription:
  80. 'NomadMania app needs access to your location to show relevant data.'
  81. },
  82. privacyManifests: {
  83. NSPrivacyAccessedAPITypes: [
  84. {
  85. NSPrivacyAccessedAPIType: 'NSPrivacyAccessedAPICategoryUserDefaults',
  86. NSPrivacyAccessedAPITypeReasons: ['CA92.1']
  87. }
  88. ]
  89. }
  90. },
  91. android: {
  92. package: env.PACKAGE_NAME_ANDROID, // com.nomadmania.presentation
  93. config: {
  94. googleMaps: {
  95. apiKey: env.ANDROID_GOOGLE_MAP_APIKEY
  96. }
  97. },
  98. googleServicesFile: './google-services.json',
  99. permissions: [
  100. // 'ACCESS_BACKGROUND_LOCATION',
  101. 'ACCESS_FINE_LOCATION',
  102. 'ACCESS_COARSE_LOCATION',
  103. 'READ_EXTERNAL_STORAGE',
  104. 'WRITE_EXTERNAL_STORAGE',
  105. 'NOTIFICATIONS',
  106. 'USER_FACING_NOTIFICATIONS',
  107. 'INTERNET',
  108. 'CAMERA',
  109. 'MODIFY_AUDIO_SETTINGS'
  110. ],
  111. versionCode: 79 // next version submitted to Google Play needs to be higher than that 2.0.26
  112. },
  113. plugins: [
  114. [
  115. 'expo-image-picker',
  116. {
  117. photosPermission: 'Allow NomadMania.com access to your photo library to upload photos.',
  118. cameraPermission: 'Allow NomadMania.com access to your camera to upload photos directly.'
  119. }
  120. ],
  121. [
  122. 'expo-build-properties',
  123. {
  124. android: {
  125. minSdkVersion: 24,
  126. targetSdkVersion: 34
  127. // kotlinVersion: '1.7.1'
  128. }
  129. }
  130. ],
  131. [
  132. '@sentry/react-native/expo',
  133. {
  134. organization: env.SENTRY_ORG,
  135. project: env.SENTRY_PROJECT,
  136. url: 'https://sentry.io/'
  137. }
  138. ],
  139. [
  140. 'expo-asset',
  141. {
  142. assets: [
  143. './assets/db/nmRegions.db',
  144. './assets/db/darePlaces.db',
  145. './assets/db/nmCountries.db'
  146. ]
  147. }
  148. ],
  149. 'expo-font',
  150. [
  151. 'expo-av',
  152. {
  153. microphonePermission: 'Allow Nomadmania to access your microphone.'
  154. }
  155. ],
  156. ['@maplibre/maplibre-react-native']
  157. ]
  158. });