app.config.ts 4.7 KB

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