app.config.ts 6.1 KB

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