app.config.ts 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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.12',
  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. },
  41. notification: {
  42. icon: './assets/notification-icon.png'
  43. },
  44. updates: {
  45. url: 'https://u.expo.dev/c31c6828-3c32-4c7a-aabc-f9b8336b3b66'
  46. },
  47. platforms: ['ios', 'android'],
  48. assetBundlePatterns: ['**/*'],
  49. ios: {
  50. supportsTablet: false,
  51. bundleIdentifier: env.PACKAGE_NAME_IOS, // com.nomadmania.app2
  52. config: {
  53. googleMapsApiKey: env.IOS_GOOGLE_MAP_APIKEY
  54. },
  55. infoPlist: {
  56. UIBackgroundModes: ['fetch'],
  57. NSLocationAlwaysUsageDescription:
  58. 'Turn on location service to allow NomadMania.com find friends nearby.',
  59. NSPhotoLibraryUsageDescription:
  60. 'Enable NomadMania.com to access your photo library to upload your profile picture. Any violence, excess of nudity, stolen picture, or scam is forbidden',
  61. NSPhotoLibraryAddUsageDescription:
  62. 'Enable NomadMania.com to access your photo library to upload your profile picture. Any violence, excess of nudity, stolen picture, or scam is forbidden',
  63. NSPushNotificationsDescription:
  64. 'This will allow NomadMania.com to send you notifications. Also you can disable it in app settings'
  65. }
  66. },
  67. android: {
  68. package: env.PACKAGE_NAME_ANDROID, // com.nomadmania.presentation
  69. config: {
  70. googleMaps: {
  71. apiKey: env.ANDROID_GOOGLE_MAP_APIKEY
  72. },
  73. },
  74. permissions: [
  75. // 'ACCESS_BACKGROUND_LOCATION',
  76. 'ACCESS_FINE_LOCATION',
  77. 'ACCESS_COARSE_LOCATION',
  78. 'READ_EXTERNAL_STORAGE',
  79. 'WRITE_EXTERNAL_STORAGE',
  80. 'NOTIFICATIONS',
  81. 'USER_FACING_NOTIFICATIONS',
  82. 'INTERNET',
  83. 'CAMERA'
  84. ],
  85. versionCode: 63 // next version submitted to Google Play needs to be higher than that 2.0.12
  86. },
  87. plugins: [
  88. [
  89. 'expo-image-picker',
  90. {
  91. photosPermission: 'Allow NomadMania.com access to your photo library to upload photos.',
  92. cameraPermission: 'Allow NomadMania.com access to your camera to upload photos directly.'
  93. }
  94. ],
  95. [
  96. "expo-build-properties",
  97. {
  98. android: {
  99. minSdkVersion: 24,
  100. targetSdkVersion: 33,
  101. // kotlinVersion: '1.7.1'
  102. }
  103. }
  104. ],
  105. [
  106. "@sentry/react-native/expo",
  107. {
  108. organization: env.SENTRY_ORG,
  109. project: env.SENTRY_PROJECT,
  110. url: "https://sentry.io/"
  111. }
  112. ]
  113. ]
  114. });