app.config.ts 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  1. import 'dotenv/config';
  2. import path from 'path';
  3. import dotenv from 'dotenv';
  4. import type { ConfigContext, ExpoConfig } from 'expo/config';
  5. const { DEEP_LINK_PATHS } = require('./config/deepLinks');
  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 NM_API_HOST = env.NM_API_HOST;
  10. const GOOGLE_MAP_PLACES_APIKEY = env.GOOGLE_MAP_PLACES_APIKEY;
  11. const WEBSOCKET_URL =
  12. env.ENV === 'production' ? env.PRODUCTION_WEBSOCKET_URL : env.DEVELOPMENT_WEBSOCKET_URL;
  13. dotenv.config({
  14. path: path.resolve(process.cwd(), '.env')
  15. });
  16. const intentData = DEEP_LINK_PATHS.map((pathPrefix: string) => ({
  17. scheme: 'https',
  18. host: 'nomadmania.com',
  19. pathPrefix,
  20. }));
  21. export default ({ config }: ConfigContext): ExpoConfig => ({
  22. ...config,
  23. name: 'NomadMania',
  24. slug: 'nomadmania-app',
  25. owner: 'nomadmaniaou',
  26. scheme: 'nm',
  27. // Should be updated after every production release (deploy to AppStore/PlayMarket)
  28. version: '2.0.52',
  29. // Should be updated after every dependency change
  30. runtimeVersion: '1.7',
  31. orientation: 'portrait',
  32. icon: './assets/icon-logo.png',
  33. userInterfaceStyle: 'light',
  34. extra: {
  35. ENV: env.ENV,
  36. API_HOST: API_HOST,
  37. MAP_HOST: MAP_HOST,
  38. GOOGLE_MAP_PLACES_APIKEY: GOOGLE_MAP_PLACES_APIKEY,
  39. WEBSOCKET_URL: WEBSOCKET_URL,
  40. VECTOR_MAP_HOST: env.VECTOR_MAP_HOST,
  41. eas: {
  42. projectId: env.EAS_PROJECT_ID
  43. }
  44. },
  45. experiments: {
  46. tsconfigPaths: true
  47. },
  48. splash: {
  49. image: './assets/splash-screen-world.png',
  50. resizeMode: 'cover',
  51. backgroundColor: '#ffffff'
  52. },
  53. androidStatusBar: {
  54. backgroundColor: '#00000000',
  55. translucent: true,
  56. barStyle: 'dark-content'
  57. },
  58. notification: {
  59. icon: './assets/notification-android-icon.png',
  60. color: '#FFFFFF'
  61. },
  62. updates: {
  63. url: 'https://u.expo.dev/c31c6828-3c32-4c7a-aabc-f9b8336b3b66'
  64. },
  65. platforms: ['ios', 'android'],
  66. assetBundlePatterns: ['**/*', 'assets/db/*.db'],
  67. ios: {
  68. supportsTablet: false,
  69. bundleIdentifier: env.PACKAGE_NAME_IOS, // com.nomadmania.app2
  70. config: {
  71. googleMapsApiKey: env.IOS_GOOGLE_MAP_APIKEY
  72. },
  73. associatedDomains: ['applinks:nomadmania.com'],
  74. infoPlist: {
  75. UIBackgroundModes: ['location', 'fetch', 'remote-notification'],
  76. NSLocationAlwaysUsageDescription:
  77. 'NomadMania uses your location in the background so other users see your latest location and regions are marked as visited automatically.',
  78. NSPhotoLibraryUsageDescription:
  79. 'Enable NomadMania.com to access your photo library to upload your profile picture. Any violence, excess of nudity, stolen picture, or scam is forbidden',
  80. NSPhotoLibraryAddUsageDescription:
  81. 'Enable NomadMania.com to access your photo library to upload your profile picture. Any violence, excess of nudity, stolen picture, or scam is forbidden',
  82. NSPushNotificationsDescription:
  83. 'This will allow NomadMania.com to send you notifications. Also you can disable it in app settings',
  84. NSDocumentsFolderUsageDescription:
  85. 'Nomadmania app needs access to the documents folder to select files.',
  86. NSCameraUsageDescription: 'Nomadmania app needs access to the camera to record video.',
  87. NSLocationWhenInUseUsageDescription:
  88. 'NomadMania uses your location to show it to other users and to help mark regions as visited.',
  89. NSLocationAlwaysAndWhenInUseUsageDescription:
  90. 'NomadMania uses your location in the background so other users see your latest location and regions are marked as visited automatically.',
  91. LSApplicationQueriesSchemes: ['comgooglemaps']
  92. },
  93. privacyManifests: {
  94. NSPrivacyAccessedAPITypes: [
  95. {
  96. NSPrivacyAccessedAPIType: 'NSPrivacyAccessedAPICategoryUserDefaults',
  97. NSPrivacyAccessedAPITypeReasons: ['CA92.1']
  98. }
  99. ]
  100. }
  101. },
  102. android: {
  103. package: env.PACKAGE_NAME_ANDROID, // com.nomadmania.presentation
  104. config: {
  105. googleMaps: {
  106. apiKey: env.ANDROID_GOOGLE_MAP_APIKEY
  107. }
  108. },
  109. intentFilters: [
  110. {
  111. action: 'VIEW',
  112. data: intentData,
  113. category: ['BROWSABLE', 'DEFAULT']
  114. }
  115. ],
  116. googleServicesFile: './google-services.json',
  117. permissions: [
  118. 'ACCESS_BACKGROUND_LOCATION',
  119. 'ACCESS_FINE_LOCATION',
  120. 'ACCESS_COARSE_LOCATION',
  121. 'READ_EXTERNAL_STORAGE',
  122. 'WRITE_EXTERNAL_STORAGE',
  123. 'NOTIFICATIONS',
  124. 'USER_FACING_NOTIFICATIONS',
  125. 'INTERNET',
  126. 'CAMERA',
  127. 'MODIFY_AUDIO_SETTINGS'
  128. ],
  129. splash: {
  130. backgroundColor: '#ffffff',
  131. imageWidth: 200,
  132. image: './assets/icon-logo.png',
  133. resizeMode: 'contain'
  134. },
  135. versionCode: 114 // 2.0.52, last version sent to Google is 113 (2.0.51)
  136. },
  137. plugins: [
  138. [
  139. 'expo-image-picker',
  140. {
  141. photosPermission: 'Allow NomadMania.com access to your photo library to upload photos.',
  142. cameraPermission: 'Allow NomadMania.com access to your camera to upload photos directly.'
  143. }
  144. ],
  145. [
  146. 'expo-build-properties',
  147. {
  148. ios: {
  149. newArchEnabled: true,
  150. deploymentTarget: '15.1'
  151. },
  152. android: {
  153. minSdkVersion: 24,
  154. targetSdkVersion: 36
  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-audio',
  181. {
  182. microphonePermission: 'Allow Nomadmania to access your microphone.'
  183. }
  184. ],
  185. [
  186. 'expo-video',
  187. {
  188. supportsBackgroundPlayback: true,
  189. supportsPictureInPicture: true
  190. }
  191. ],
  192. ['@maplibre/maplibre-react-native'],
  193. [
  194. 'expo-location',
  195. {
  196. isIosBackgroundLocationEnabled: true,
  197. isAndroidBackgroundLocationEnabled: false
  198. }
  199. ],
  200. 'react-native-compressor'
  201. ]
  202. });