app.config.ts 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  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.21',
  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. eas: {
  34. projectId: env.EAS_PROJECT_ID
  35. }
  36. },
  37. experiments: {
  38. tsconfigPaths: true
  39. },
  40. splash: {
  41. image: './assets/loading-screen.png',
  42. resizeMode: 'cover',
  43. backgroundColor: '#ffffff'
  44. },
  45. notification: {
  46. icon: './assets/notification-icon.png'
  47. },
  48. updates: {
  49. url: 'https://u.expo.dev/c31c6828-3c32-4c7a-aabc-f9b8336b3b66'
  50. },
  51. platforms: ['ios', 'android'],
  52. assetBundlePatterns: ['**/*', 'assets/db/*.db'],
  53. ios: {
  54. supportsTablet: false,
  55. bundleIdentifier: env.PACKAGE_NAME_IOS, // com.nomadmania.app2
  56. config: {
  57. googleMapsApiKey: env.IOS_GOOGLE_MAP_APIKEY
  58. },
  59. infoPlist: {
  60. UIBackgroundModes: ['fetch'],
  61. NSLocationAlwaysUsageDescription:
  62. 'Turn on location service to allow NomadMania.com find friends nearby.',
  63. NSPhotoLibraryUsageDescription:
  64. 'Enable NomadMania.com to access your photo library to upload your profile picture. Any violence, excess of nudity, stolen picture, or scam is forbidden',
  65. NSPhotoLibraryAddUsageDescription:
  66. 'Enable NomadMania.com to access your photo library to upload your profile picture. Any violence, excess of nudity, stolen picture, or scam is forbidden',
  67. NSPushNotificationsDescription:
  68. 'This will allow NomadMania.com to send you notifications. Also you can disable it in app settings',
  69. NSMicrophoneUsageDescription:
  70. 'Nomadmania app needs access to the microphone to record audio.',
  71. NSDocumentsFolderUsageDescription:
  72. 'Nomadmania app needs access to the documents folder to select files.',
  73. NSCameraUsageDescription: 'Nomadmania app needs access to the camera to record video.',
  74. NSLocationWhenInUseUsageDescription:
  75. 'NomadMania app needs access to your location to show relevant data.'
  76. },
  77. privacyManifests: {
  78. NSPrivacyAccessedAPITypes: [
  79. {
  80. NSPrivacyAccessedAPIType: 'NSPrivacyAccessedAPICategoryUserDefaults',
  81. NSPrivacyAccessedAPITypeReasons: ['CA92.1']
  82. }
  83. ]
  84. }
  85. },
  86. android: {
  87. package: env.PACKAGE_NAME_ANDROID, // com.nomadmania.presentation
  88. config: {
  89. googleMaps: {
  90. apiKey: env.ANDROID_GOOGLE_MAP_APIKEY
  91. }
  92. },
  93. googleServicesFile: './google-services.json',
  94. permissions: [
  95. // 'ACCESS_BACKGROUND_LOCATION',
  96. 'ACCESS_FINE_LOCATION',
  97. 'ACCESS_COARSE_LOCATION',
  98. 'READ_EXTERNAL_STORAGE',
  99. 'WRITE_EXTERNAL_STORAGE',
  100. 'NOTIFICATIONS',
  101. 'USER_FACING_NOTIFICATIONS',
  102. 'INTERNET',
  103. 'CAMERA',
  104. 'RECORD_AUDIO',
  105. 'MODIFY_AUDIO_SETTINGS'
  106. ],
  107. versionCode: 74 // next version submitted to Google Play needs to be higher than that 2.0.21
  108. },
  109. plugins: [
  110. [
  111. 'expo-image-picker',
  112. {
  113. photosPermission: 'Allow NomadMania.com access to your photo library to upload photos.',
  114. cameraPermission: 'Allow NomadMania.com access to your camera to upload photos directly.'
  115. }
  116. ],
  117. [
  118. 'expo-build-properties',
  119. {
  120. android: {
  121. minSdkVersion: 24,
  122. targetSdkVersion: 34
  123. // kotlinVersion: '1.7.1'
  124. }
  125. }
  126. ],
  127. [
  128. '@sentry/react-native/expo',
  129. {
  130. organization: env.SENTRY_ORG,
  131. project: env.SENTRY_PROJECT,
  132. url: 'https://sentry.io/'
  133. }
  134. ],
  135. [
  136. 'expo-asset',
  137. {
  138. assets: [
  139. './assets/db/nmRegions.db',
  140. './assets/db/darePlaces.db',
  141. './assets/db/nmCountries.db'
  142. ]
  143. }
  144. ],
  145. 'expo-font',
  146. [
  147. 'expo-av',
  148. {
  149. microphonePermission: 'Allow Nomadmania to access your microphone.'
  150. }
  151. ],
  152. ['@react-native-firebase/messaging']
  153. ]
  154. });