app.config.ts 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  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. dotenv.config({
  10. path: path.resolve(process.cwd(), '.env')
  11. });
  12. export default ({ config }: ConfigContext): ExpoConfig => ({
  13. ...config,
  14. name: 'NomadMania',
  15. slug: 'nomadmania-app',
  16. owner: 'nomadmaniaou',
  17. scheme: 'nm',
  18. // Should be updated after every production release (deploy to AppStore/PlayMarket)
  19. version: '2.0.17',
  20. // Should be updated after every dependency change
  21. runtimeVersion: '1.5',
  22. orientation: 'portrait',
  23. icon: './assets/icon.png',
  24. userInterfaceStyle: 'light',
  25. extra: {
  26. ENV: env.ENV,
  27. API_HOST: API_HOST,
  28. MAP_HOST: MAP_HOST,
  29. GOOGLE_MAP_PLACES_APIKEY: GOOGLE_MAP_PLACES_APIKEY,
  30. eas: {
  31. projectId: env.EAS_PROJECT_ID
  32. }
  33. },
  34. experiments: {
  35. tsconfigPaths: true
  36. },
  37. splash: {
  38. image: './assets/loading-screen.png',
  39. resizeMode: 'cover',
  40. backgroundColor: '#ffffff'
  41. },
  42. notification: {
  43. icon: './assets/notification-icon.png'
  44. },
  45. updates: {
  46. url: 'https://u.expo.dev/c31c6828-3c32-4c7a-aabc-f9b8336b3b66'
  47. },
  48. platforms: ['ios', 'android'],
  49. assetBundlePatterns: ['**/*'],
  50. ios: {
  51. supportsTablet: false,
  52. bundleIdentifier: env.PACKAGE_NAME_IOS, // com.nomadmania.app2
  53. config: {
  54. googleMapsApiKey: env.IOS_GOOGLE_MAP_APIKEY
  55. },
  56. infoPlist: {
  57. UIBackgroundModes: ['fetch'],
  58. NSLocationAlwaysUsageDescription:
  59. 'Turn on location service to allow NomadMania.com find friends nearby.',
  60. NSPhotoLibraryUsageDescription:
  61. 'Enable NomadMania.com to access your photo library to upload your profile picture. Any violence, excess of nudity, stolen picture, or scam is forbidden',
  62. NSPhotoLibraryAddUsageDescription:
  63. 'Enable NomadMania.com to access your photo library to upload your profile picture. Any violence, excess of nudity, stolen picture, or scam is forbidden',
  64. NSPushNotificationsDescription:
  65. 'This will allow NomadMania.com to send you notifications. Also you can disable it in app settings',
  66. NSMicrophoneUsageDescription: "Nomadmania app needs access to the microphone to record audio.",
  67. NSDocumentsFolderUsageDescription: "Nomadmania app needs access to the documents folder to select files.",
  68. NSCameraUsageDescription: "Nomadmania app needs access to the camera to record video."
  69. },
  70. privacyManifests: {
  71. NSPrivacyAccessedAPITypes: [
  72. {
  73. NSPrivacyAccessedAPIType: 'NSPrivacyAccessedAPICategoryUserDefaults',
  74. NSPrivacyAccessedAPITypeReasons: ['CA92.1']
  75. }
  76. ]
  77. }
  78. },
  79. android: {
  80. package: env.PACKAGE_NAME_ANDROID, // com.nomadmania.presentation
  81. config: {
  82. googleMaps: {
  83. apiKey: env.ANDROID_GOOGLE_MAP_APIKEY
  84. }
  85. },
  86. googleServicesFile: './google-services.json',
  87. permissions: [
  88. // 'ACCESS_BACKGROUND_LOCATION',
  89. 'ACCESS_FINE_LOCATION',
  90. 'ACCESS_COARSE_LOCATION',
  91. 'READ_EXTERNAL_STORAGE',
  92. 'WRITE_EXTERNAL_STORAGE',
  93. 'NOTIFICATIONS',
  94. 'USER_FACING_NOTIFICATIONS',
  95. 'INTERNET',
  96. 'CAMERA',
  97. "RECORD_AUDIO",
  98. 'MODIFY_AUDIO_SETTINGS'
  99. ],
  100. versionCode: 70 // next version submitted to Google Play needs to be higher than that 2.0.17
  101. },
  102. plugins: [
  103. [
  104. 'expo-image-picker',
  105. {
  106. photosPermission: 'Allow NomadMania.com access to your photo library to upload photos.',
  107. cameraPermission: 'Allow NomadMania.com access to your camera to upload photos directly.'
  108. }
  109. ],
  110. [
  111. 'expo-build-properties',
  112. {
  113. android: {
  114. minSdkVersion: 24,
  115. targetSdkVersion: 34
  116. // kotlinVersion: '1.7.1'
  117. }
  118. }
  119. ],
  120. [
  121. '@sentry/react-native/expo',
  122. {
  123. organization: env.SENTRY_ORG,
  124. project: env.SENTRY_PROJECT,
  125. url: 'https://sentry.io/'
  126. }
  127. ],
  128. ['expo-asset', 'expo-font'],
  129. [
  130. "expo-av",
  131. {
  132. "microphonePermission": "Allow Nomadmania to access your microphone."
  133. }
  134. ]
  135. ]
  136. });