app.config.ts 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  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.33',
  22. // Should be updated after every dependency change
  23. runtimeVersion: '1.6',
  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. associatedDomains: ['applinks:nomadmania.com'],
  67. infoPlist: {
  68. UIBackgroundModes: ['location', 'fetch', 'remote-notification'],
  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. NSLocationAlwaysAndWhenInUseUsageDescription:
  83. 'NomadMania app needs access to your location to show relevant data.'
  84. },
  85. privacyManifests: {
  86. NSPrivacyAccessedAPITypes: [
  87. {
  88. NSPrivacyAccessedAPIType: 'NSPrivacyAccessedAPICategoryUserDefaults',
  89. NSPrivacyAccessedAPITypeReasons: ['CA92.1']
  90. }
  91. ]
  92. }
  93. },
  94. android: {
  95. package: env.PACKAGE_NAME_ANDROID, // com.nomadmania.presentation
  96. config: {
  97. googleMaps: {
  98. apiKey: env.ANDROID_GOOGLE_MAP_APIKEY
  99. }
  100. },
  101. intentFilters: [
  102. {
  103. action: 'VIEW',
  104. data: [
  105. {
  106. scheme: 'https',
  107. host: 'nomadmania.com',
  108. pathPrefix: '/profile/'
  109. }
  110. ],
  111. category: ['BROWSABLE', 'DEFAULT']
  112. }
  113. ],
  114. googleServicesFile: './google-services.json',
  115. permissions: [
  116. 'ACCESS_BACKGROUND_LOCATION',
  117. 'ACCESS_FINE_LOCATION',
  118. 'ACCESS_COARSE_LOCATION',
  119. 'READ_EXTERNAL_STORAGE',
  120. 'WRITE_EXTERNAL_STORAGE',
  121. 'NOTIFICATIONS',
  122. 'USER_FACING_NOTIFICATIONS',
  123. 'INTERNET',
  124. 'CAMERA',
  125. 'MODIFY_AUDIO_SETTINGS',
  126. 'FOREGROUND_SERVICE'
  127. ],
  128. versionCode: 87 // 2.0.33, last version sent to Google is 86 (2.0.32)
  129. },
  130. plugins: [
  131. [
  132. 'expo-image-picker',
  133. {
  134. photosPermission: 'Allow NomadMania.com access to your photo library to upload photos.',
  135. cameraPermission: 'Allow NomadMania.com access to your camera to upload photos directly.'
  136. }
  137. ],
  138. [
  139. 'expo-build-properties',
  140. {
  141. android: {
  142. minSdkVersion: 24,
  143. targetSdkVersion: 34
  144. // kotlinVersion: '1.7.1'
  145. }
  146. }
  147. ],
  148. [
  149. '@sentry/react-native/expo',
  150. {
  151. organization: env.SENTRY_ORG,
  152. project: env.SENTRY_PROJECT,
  153. url: 'https://sentry.io/'
  154. }
  155. ],
  156. [
  157. 'expo-asset',
  158. {
  159. assets: [
  160. './assets/db/nmRegions.db',
  161. './assets/db/darePlaces.db',
  162. './assets/db/nmCountries.db'
  163. ]
  164. }
  165. ],
  166. 'expo-font',
  167. [
  168. 'expo-av',
  169. {
  170. microphonePermission: 'Allow Nomadmania to access your microphone.'
  171. }
  172. ],
  173. ['@maplibre/maplibre-react-native'],
  174. [
  175. 'expo-location',
  176. {
  177. isIosBackgroundLocationEnabled: true,
  178. isAndroidBackgroundLocationEnabled: true
  179. }
  180. ]
  181. ]
  182. });