app.config.ts 4.6 KB

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