app.config.ts 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. import 'dotenv/config';
  2. import { env } from 'process';
  3. import path from 'path';
  4. import dotenv from 'dotenv';
  5. import type { ConfigContext, ExpoConfig } from 'expo/config';
  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. },
  68. android: {
  69. package: env.PACKAGE_NAME_ANDROID, // com.nomadmania.presentation
  70. config: {
  71. googleMaps: {
  72. apiKey: env.ANDROID_GOOGLE_MAP_APIKEY
  73. },
  74. },
  75. permissions: [
  76. // 'ACCESS_BACKGROUND_LOCATION',
  77. 'ACCESS_FINE_LOCATION',
  78. 'ACCESS_COARSE_LOCATION',
  79. 'READ_EXTERNAL_STORAGE',
  80. 'WRITE_EXTERNAL_STORAGE',
  81. 'NOTIFICATIONS',
  82. 'USER_FACING_NOTIFICATIONS',
  83. 'INTERNET',
  84. 'CAMERA'
  85. ],
  86. versionCode: 68 // next version submitted to Google Play needs to be higher than that 2.0.16
  87. },
  88. plugins: [
  89. [
  90. 'expo-image-picker',
  91. {
  92. photosPermission: 'Allow NomadMania.com access to your photo library to upload photos.',
  93. cameraPermission: 'Allow NomadMania.com access to your camera to upload photos directly.'
  94. }
  95. ],
  96. [
  97. "expo-build-properties",
  98. {
  99. android: {
  100. minSdkVersion: 24,
  101. targetSdkVersion: 34,
  102. // kotlinVersion: '1.7.1'
  103. }
  104. }
  105. ],
  106. [
  107. "@sentry/react-native/expo",
  108. {
  109. organization: env.SENTRY_ORG,
  110. project: env.SENTRY_PROJECT,
  111. url: "https://sentry.io/"
  112. }
  113. ]
  114. ]
  115. });