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. import { Platform } from 'react-native';
  6. const env = process.env;
  7. const API_HOST = env.ENV === 'production' ? env.PRODUCTION_API_HOST : env.DEVELOPMENT_API_HOST;
  8. const MAP_HOST = env.ENV === 'production' ? env.PRODUCTION_MAP_HOST : env.DEVELOPMENT_MAP_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.21',
  23. // Should be updated after every dependency change
  24. runtimeVersion: '1.5',
  25. orientation: 'portrait',
  26. icon: './assets/icon.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. 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. notification: Platform.select({
  47. ios: {
  48. icon: './assets/notification-icon.png',
  49. color: '#FFFFFF'
  50. },
  51. android: {
  52. icon: './assets/notification-android-icon.png',
  53. color: '#FFFFFF'
  54. }
  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. infoPlist: {
  68. UIBackgroundModes: ['fetch'],
  69. NSLocationAlwaysUsageDescription:
  70. 'Turn on location service to allow NomadMania.com find friends nearby.',
  71. NSPhotoLibraryUsageDescription:
  72. 'Enable NomadMania.com to access your photo library to upload your profile picture. Any violence, excess of nudity, stolen picture, or scam is forbidden',
  73. NSPhotoLibraryAddUsageDescription:
  74. 'Enable NomadMania.com to access your photo library to upload your profile picture. Any violence, excess of nudity, stolen picture, or scam is forbidden',
  75. NSPushNotificationsDescription:
  76. 'This will allow NomadMania.com to send you notifications. Also you can disable it in app settings',
  77. NSDocumentsFolderUsageDescription:
  78. 'Nomadmania app needs access to the documents folder to select files.',
  79. NSCameraUsageDescription: 'Nomadmania app needs access to the camera to record video.',
  80. NSLocationWhenInUseUsageDescription:
  81. 'NomadMania app needs access to your location to show relevant data.'
  82. },
  83. privacyManifests: {
  84. NSPrivacyAccessedAPITypes: [
  85. {
  86. NSPrivacyAccessedAPIType: 'NSPrivacyAccessedAPICategoryUserDefaults',
  87. NSPrivacyAccessedAPITypeReasons: ['CA92.1']
  88. }
  89. ]
  90. }
  91. },
  92. android: {
  93. package: env.PACKAGE_NAME_ANDROID, // com.nomadmania.presentation
  94. config: {
  95. googleMaps: {
  96. apiKey: env.ANDROID_GOOGLE_MAP_APIKEY
  97. }
  98. },
  99. googleServicesFile: './google-services.json',
  100. permissions: [
  101. // 'ACCESS_BACKGROUND_LOCATION',
  102. 'ACCESS_FINE_LOCATION',
  103. 'ACCESS_COARSE_LOCATION',
  104. 'READ_EXTERNAL_STORAGE',
  105. 'WRITE_EXTERNAL_STORAGE',
  106. 'NOTIFICATIONS',
  107. 'USER_FACING_NOTIFICATIONS',
  108. 'INTERNET',
  109. 'CAMERA',
  110. 'MODIFY_AUDIO_SETTINGS'
  111. ],
  112. versionCode: 74 // next version submitted to Google Play needs to be higher than that 2.0.21
  113. },
  114. plugins: [
  115. [
  116. 'expo-image-picker',
  117. {
  118. photosPermission: 'Allow NomadMania.com access to your photo library to upload photos.',
  119. cameraPermission: 'Allow NomadMania.com access to your camera to upload photos directly.'
  120. }
  121. ],
  122. [
  123. 'expo-build-properties',
  124. {
  125. android: {
  126. minSdkVersion: 24,
  127. targetSdkVersion: 34
  128. // kotlinVersion: '1.7.1'
  129. }
  130. }
  131. ],
  132. [
  133. '@sentry/react-native/expo',
  134. {
  135. organization: env.SENTRY_ORG,
  136. project: env.SENTRY_PROJECT,
  137. url: 'https://sentry.io/'
  138. }
  139. ],
  140. [
  141. 'expo-asset',
  142. {
  143. assets: [
  144. './assets/db/nmRegions.db',
  145. './assets/db/darePlaces.db',
  146. './assets/db/nmCountries.db'
  147. ]
  148. }
  149. ],
  150. 'expo-font',
  151. [
  152. 'expo-av',
  153. {
  154. microphonePermission: 'Allow Nomadmania to access your microphone.'
  155. }
  156. ],
  157. ]
  158. });