app.config.ts 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  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. newArchEnabled: true,
  19. owner: 'nomadmaniaou',
  20. scheme: 'nm',
  21. // Should be updated after every production release (deploy to AppStore/PlayMarket)
  22. version: '2.0.42',
  23. // Should be updated after every dependency change
  24. runtimeVersion: '1.7',
  25. orientation: 'portrait',
  26. icon: './assets/icon-logo.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. VECTOR_MAP_HOST: env.VECTOR_MAP_HOST,
  35. eas: {
  36. projectId: env.EAS_PROJECT_ID
  37. }
  38. },
  39. experiments: {
  40. tsconfigPaths: true
  41. },
  42. splash: {
  43. image: './assets/splash-screen-world.png',
  44. resizeMode: 'cover',
  45. backgroundColor: '#ffffff'
  46. },
  47. androidStatusBar: {
  48. backgroundColor: '#00000000',
  49. translucent: true,
  50. barStyle: 'dark-content'
  51. },
  52. notification: {
  53. icon: './assets/notification-android-icon.png',
  54. color: '#FFFFFF'
  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. associatedDomains: ['applinks:nomadmania.com'],
  68. infoPlist: {
  69. UIBackgroundModes: ['location', 'fetch', 'remote-notification'],
  70. NSLocationAlwaysUsageDescription:
  71. 'NomadMania uses your location in the background so other users see your latest location and regions are marked as visited automatically.',
  72. NSPhotoLibraryUsageDescription:
  73. 'Enable NomadMania.com to access your photo library to upload your profile picture. Any violence, excess of nudity, stolen picture, or scam is forbidden',
  74. NSPhotoLibraryAddUsageDescription:
  75. 'Enable NomadMania.com to access your photo library to upload your profile picture. Any violence, excess of nudity, stolen picture, or scam is forbidden',
  76. NSPushNotificationsDescription:
  77. 'This will allow NomadMania.com to send you notifications. Also you can disable it in app settings',
  78. NSDocumentsFolderUsageDescription:
  79. 'Nomadmania app needs access to the documents folder to select files.',
  80. NSCameraUsageDescription: 'Nomadmania app needs access to the camera to record video.',
  81. NSLocationWhenInUseUsageDescription:
  82. 'NomadMania uses your location to show it to other users and to help mark regions as visited.',
  83. NSLocationAlwaysAndWhenInUseUsageDescription:
  84. 'NomadMania uses your location in the background so other users see your latest location and regions are marked as visited automatically.',
  85. LSApplicationQueriesSchemes: ['comgooglemaps']
  86. },
  87. privacyManifests: {
  88. NSPrivacyAccessedAPITypes: [
  89. {
  90. NSPrivacyAccessedAPIType: 'NSPrivacyAccessedAPICategoryUserDefaults',
  91. NSPrivacyAccessedAPITypeReasons: ['CA92.1']
  92. }
  93. ]
  94. }
  95. },
  96. android: {
  97. package: env.PACKAGE_NAME_ANDROID, // com.nomadmania.presentation
  98. config: {
  99. googleMaps: {
  100. apiKey: env.ANDROID_GOOGLE_MAP_APIKEY
  101. }
  102. },
  103. intentFilters: [
  104. {
  105. action: 'VIEW',
  106. data: [
  107. {
  108. scheme: 'https',
  109. host: 'nomadmania.com',
  110. pathPrefix: '/profile/'
  111. },
  112. {
  113. scheme: 'https',
  114. host: 'nomadmania.com',
  115. pathPrefix: '/event/'
  116. },
  117. {
  118. scheme: 'https',
  119. host: 'nomadmania.com',
  120. pathPrefix: '/map/'
  121. }
  122. ],
  123. category: ['BROWSABLE', 'DEFAULT']
  124. }
  125. ],
  126. googleServicesFile: './google-services.json',
  127. permissions: [
  128. 'ACCESS_BACKGROUND_LOCATION',
  129. 'ACCESS_FINE_LOCATION',
  130. 'ACCESS_COARSE_LOCATION',
  131. 'READ_EXTERNAL_STORAGE',
  132. 'WRITE_EXTERNAL_STORAGE',
  133. 'NOTIFICATIONS',
  134. 'USER_FACING_NOTIFICATIONS',
  135. 'INTERNET',
  136. 'CAMERA',
  137. 'MODIFY_AUDIO_SETTINGS',
  138. 'READ_MEDIA_VIDEO'
  139. ],
  140. versionCode: 100 // 2.0.42, last version sent to Google is 99 (2.0.41)
  141. },
  142. plugins: [
  143. [
  144. 'expo-image-picker',
  145. {
  146. photosPermission: 'Allow NomadMania.com access to your photo library to upload photos.',
  147. cameraPermission: 'Allow NomadMania.com access to your camera to upload photos directly.'
  148. }
  149. ],
  150. [
  151. 'expo-build-properties',
  152. {
  153. ios: {
  154. newArchEnabled: true,
  155. deploymentTarget: '15.1'
  156. },
  157. android: {
  158. minSdkVersion: 24,
  159. targetSdkVersion: 35
  160. // kotlinVersion: '1.7.1'
  161. }
  162. }
  163. ],
  164. [
  165. '@sentry/react-native/expo',
  166. {
  167. organization: env.SENTRY_ORG,
  168. note: 'Use SENTRY_AUTH_TOKEN env to authenticate with Sentry.',
  169. project: env.SENTRY_PROJECT,
  170. url: 'https://sentry.io/'
  171. }
  172. ],
  173. [
  174. 'expo-asset',
  175. {
  176. assets: [
  177. './assets/db/nmRegions.db',
  178. './assets/db/darePlaces.db',
  179. './assets/db/nmCountries.db'
  180. ]
  181. }
  182. ],
  183. 'expo-font',
  184. [
  185. 'expo-av',
  186. {
  187. microphonePermission: 'Allow Nomadmania to access your microphone.'
  188. }
  189. ],
  190. ['@maplibre/maplibre-react-native'],
  191. [
  192. 'expo-location',
  193. {
  194. isIosBackgroundLocationEnabled: true,
  195. isAndroidBackgroundLocationEnabled: false
  196. }
  197. ]
  198. ]
  199. });