app.config.ts 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  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.38',
  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. 'NomadMania uses your location in the background so other users see your latest location and regions are marked as visited automatically.',
  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 uses your location to show it to other users and to help mark regions as visited.',
  82. NSLocationAlwaysAndWhenInUseUsageDescription:
  83. 'NomadMania uses your location in the background so other users see your latest location and regions are marked as visited automatically.',
  84. LSApplicationQueriesSchemes: ['comgooglemaps']
  85. },
  86. privacyManifests: {
  87. NSPrivacyAccessedAPITypes: [
  88. {
  89. NSPrivacyAccessedAPIType: 'NSPrivacyAccessedAPICategoryUserDefaults',
  90. NSPrivacyAccessedAPITypeReasons: ['CA92.1']
  91. }
  92. ]
  93. }
  94. },
  95. android: {
  96. package: env.PACKAGE_NAME_ANDROID, // com.nomadmania.presentation
  97. config: {
  98. googleMaps: {
  99. apiKey: env.ANDROID_GOOGLE_MAP_APIKEY
  100. }
  101. },
  102. intentFilters: [
  103. {
  104. action: 'VIEW',
  105. data: [
  106. {
  107. scheme: 'https',
  108. host: 'nomadmania.com',
  109. pathPrefix: '/profile/'
  110. },
  111. {
  112. scheme: 'https',
  113. host: 'nomadmania.com',
  114. pathPrefix: '/event/'
  115. },
  116. {
  117. scheme: 'https',
  118. host: 'nomadmania.com',
  119. pathPrefix: '/map/'
  120. }
  121. ],
  122. category: ['BROWSABLE', 'DEFAULT']
  123. }
  124. ],
  125. googleServicesFile: './google-services.json',
  126. permissions: [
  127. 'ACCESS_BACKGROUND_LOCATION',
  128. 'ACCESS_FINE_LOCATION',
  129. 'ACCESS_COARSE_LOCATION',
  130. 'READ_EXTERNAL_STORAGE',
  131. 'WRITE_EXTERNAL_STORAGE',
  132. 'NOTIFICATIONS',
  133. 'USER_FACING_NOTIFICATIONS',
  134. 'INTERNET',
  135. 'CAMERA',
  136. 'MODIFY_AUDIO_SETTINGS',
  137. 'READ_MEDIA_VIDEO'
  138. ],
  139. versionCode: 96 // 2.0.38, last version sent to Google is 95 (2.0.37)
  140. },
  141. plugins: [
  142. [
  143. 'expo-image-picker',
  144. {
  145. photosPermission: 'Allow NomadMania.com access to your photo library to upload photos.',
  146. cameraPermission: 'Allow NomadMania.com access to your camera to upload photos directly.'
  147. }
  148. ],
  149. [
  150. 'expo-build-properties',
  151. {
  152. android: {
  153. minSdkVersion: 24,
  154. targetSdkVersion: 34
  155. // kotlinVersion: '1.7.1'
  156. }
  157. }
  158. ],
  159. [
  160. '@sentry/react-native/expo',
  161. {
  162. organization: env.SENTRY_ORG,
  163. note: 'Use SENTRY_AUTH_TOKEN env to authenticate with Sentry.',
  164. project: env.SENTRY_PROJECT,
  165. url: 'https://sentry.io/'
  166. }
  167. ],
  168. [
  169. 'expo-asset',
  170. {
  171. assets: [
  172. './assets/db/nmRegions.db',
  173. './assets/db/darePlaces.db',
  174. './assets/db/nmCountries.db'
  175. ]
  176. }
  177. ],
  178. 'expo-font',
  179. [
  180. 'expo-av',
  181. {
  182. microphonePermission: 'Allow Nomadmania to access your microphone.'
  183. }
  184. ],
  185. ['@maplibre/maplibre-react-native'],
  186. [
  187. 'expo-location',
  188. {
  189. isIosBackgroundLocationEnabled: true,
  190. isAndroidBackgroundLocationEnabled: false
  191. }
  192. ]
  193. ]
  194. });