app.config.ts 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  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.28',
  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. NSLocationAlwaysAndWhenInUseUsageDescription:
  82. 'NomadMania app needs access to your location to show relevant data.'
  83. },
  84. privacyManifests: {
  85. NSPrivacyAccessedAPITypes: [
  86. {
  87. NSPrivacyAccessedAPIType: 'NSPrivacyAccessedAPICategoryUserDefaults',
  88. NSPrivacyAccessedAPITypeReasons: ['CA92.1']
  89. }
  90. ]
  91. }
  92. },
  93. android: {
  94. package: env.PACKAGE_NAME_ANDROID, // com.nomadmania.presentation
  95. config: {
  96. googleMaps: {
  97. apiKey: env.ANDROID_GOOGLE_MAP_APIKEY
  98. }
  99. },
  100. googleServicesFile: './google-services.json',
  101. permissions: [
  102. // 'ACCESS_BACKGROUND_LOCATION',
  103. 'ACCESS_FINE_LOCATION',
  104. 'ACCESS_COARSE_LOCATION',
  105. 'READ_EXTERNAL_STORAGE',
  106. 'WRITE_EXTERNAL_STORAGE',
  107. 'NOTIFICATIONS',
  108. 'USER_FACING_NOTIFICATIONS',
  109. 'INTERNET',
  110. 'CAMERA',
  111. 'MODIFY_AUDIO_SETTINGS'
  112. ],
  113. versionCode: 81 // next version submitted to Google Play needs to be higher than that 2.0.28
  114. },
  115. plugins: [
  116. [
  117. 'expo-image-picker',
  118. {
  119. photosPermission: 'Allow NomadMania.com access to your photo library to upload photos.',
  120. cameraPermission: 'Allow NomadMania.com access to your camera to upload photos directly.'
  121. }
  122. ],
  123. [
  124. 'expo-build-properties',
  125. {
  126. android: {
  127. minSdkVersion: 24,
  128. targetSdkVersion: 34
  129. // kotlinVersion: '1.7.1'
  130. }
  131. }
  132. ],
  133. [
  134. '@sentry/react-native/expo',
  135. {
  136. organization: env.SENTRY_ORG,
  137. project: env.SENTRY_PROJECT,
  138. url: 'https://sentry.io/'
  139. }
  140. ],
  141. [
  142. 'expo-asset',
  143. {
  144. assets: [
  145. './assets/db/nmRegions.db',
  146. './assets/db/darePlaces.db',
  147. './assets/db/nmCountries.db'
  148. ]
  149. }
  150. ],
  151. 'expo-font',
  152. [
  153. 'expo-av',
  154. {
  155. microphonePermission: 'Allow Nomadmania to access your microphone.'
  156. }
  157. ],
  158. ['@maplibre/maplibre-react-native']
  159. // [
  160. // 'expo-location',
  161. // {
  162. // isIosBackgroundLocationEnabled: true,
  163. // isAndroidBackgroundLocationEnabled: true
  164. // }
  165. // ]
  166. ]
  167. });