app.config.ts 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  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.16',
  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. },
  67. privacyManifests: {
  68. NSPrivacyAccessedAPITypes: [
  69. {
  70. NSPrivacyAccessedAPIType: 'NSPrivacyAccessedAPICategoryUserDefaults',
  71. NSPrivacyAccessedAPITypeReasons: ['CA92.1']
  72. }
  73. ]
  74. }
  75. },
  76. android: {
  77. package: env.PACKAGE_NAME_ANDROID, // com.nomadmania.presentation
  78. config: {
  79. googleMaps: {
  80. apiKey: env.ANDROID_GOOGLE_MAP_APIKEY
  81. }
  82. },
  83. googleServicesFile: './google-services.json',
  84. permissions: [
  85. // 'ACCESS_BACKGROUND_LOCATION',
  86. 'ACCESS_FINE_LOCATION',
  87. 'ACCESS_COARSE_LOCATION',
  88. 'READ_EXTERNAL_STORAGE',
  89. 'WRITE_EXTERNAL_STORAGE',
  90. 'NOTIFICATIONS',
  91. 'USER_FACING_NOTIFICATIONS',
  92. 'INTERNET',
  93. 'CAMERA'
  94. ],
  95. versionCode: 68 // next version submitted to Google Play needs to be higher than that 2.0.16
  96. },
  97. plugins: [
  98. [
  99. 'expo-image-picker',
  100. {
  101. photosPermission: 'Allow NomadMania.com access to your photo library to upload photos.',
  102. cameraPermission: 'Allow NomadMania.com access to your camera to upload photos directly.'
  103. }
  104. ],
  105. [
  106. 'expo-build-properties',
  107. {
  108. android: {
  109. minSdkVersion: 24,
  110. targetSdkVersion: 34
  111. // kotlinVersion: '1.7.1'
  112. }
  113. }
  114. ],
  115. [
  116. '@sentry/react-native/expo',
  117. {
  118. organization: env.SENTRY_ORG,
  119. project: env.SENTRY_PROJECT,
  120. url: 'https://sentry.io/'
  121. }
  122. ],
  123. ['expo-asset', 'expo-font']
  124. ]
  125. });