app.config.ts 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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. dotenv.config({
  9. path: path.resolve(process.cwd(), '.env')
  10. });
  11. export default ({ config }: ConfigContext): ExpoConfig => ({
  12. ...config,
  13. name: 'NomadMania',
  14. slug: 'nomadmania-app',
  15. owner: 'nomadmaniaou',
  16. scheme: 'nm',
  17. // Should be updated after every production release (deploy to AppStore/PlayMarket)
  18. version: '2.0.0',
  19. // Should be updated after every dependency change
  20. runtimeVersion: '1.5',
  21. orientation: 'portrait',
  22. icon: './assets/icon.png',
  23. userInterfaceStyle: 'light',
  24. extra: {
  25. ENV: env.ENV,
  26. API_HOST: API_HOST,
  27. MAP_HOST: MAP_HOST,
  28. eas: {
  29. projectId: env.EAS_PROJECT_ID
  30. }
  31. },
  32. experiments: {
  33. tsconfigPaths: true
  34. },
  35. splash: {
  36. image: './assets/loading-screen.png',
  37. resizeMode: 'cover'
  38. },
  39. notification: {
  40. icon: './assets/notification-icon.png'
  41. },
  42. updates: {
  43. url: 'https://u.expo.dev/c31c6828-3c32-4c7a-aabc-f9b8336b3b66'
  44. },
  45. platforms: ['ios', 'android'],
  46. assetBundlePatterns: ['**/*'],
  47. ios: {
  48. supportsTablet: true,
  49. bundleIdentifier: env.PACKAGE_NAME,
  50. config: {
  51. googleMapsApiKey: env.IOS_GOOGLE_MAP_APIKEY
  52. },
  53. infoPlist: {
  54. UIBackgroundModes: ['fetch'],
  55. NSLocationAlwaysUsageDescription:
  56. 'Turn on location service to allow NomadMania.com find friends nearby.',
  57. NSPhotoLibraryUsageDescription:
  58. 'Enable NomadMania.com to access your photo library to upload your profile picture. Any violence, excess of nudity, stolen picture, or scam is forbidden',
  59. NSPhotoLibraryAddUsageDescription:
  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. NSPushNotificationsDescription:
  62. 'This will allow NomadMania.com to send you notifications. Also you can disable it in app settings'
  63. }
  64. },
  65. android: {
  66. package: env.PACKAGE_NAME,
  67. config: {
  68. googleMaps: {
  69. apiKey: env.ANDROID_GOOGLE_MAP_APIKEY
  70. },
  71. },
  72. permissions: [
  73. 'ACCESS_BACKGROUND_LOCATION',
  74. 'ACCESS_FINE_LOCATION',
  75. 'ACCESS_COARSE_LOCATION',
  76. 'READ_EXTERNAL_STORAGE',
  77. 'WRITE_EXTERNAL_STORAGE',
  78. 'NOTIFICATIONS',
  79. 'USER_FACING_NOTIFICATIONS',
  80. 'INTERNET',
  81. 'CAMERA'
  82. ],
  83. versionCode: 2
  84. },
  85. plugins: [
  86. [
  87. 'expo-image-picker',
  88. {
  89. photosPermission: 'Allow NomadMania.com access to your photo library to upload photos.',
  90. cameraPermission: 'Allow NomadMania.com access to your camera to upload photos directly.'
  91. }
  92. ],
  93. [
  94. "expo-build-properties",
  95. {
  96. android: {
  97. minSdkVersion: 24,
  98. targetSdkVersion: 33
  99. }
  100. }
  101. ],
  102. ]
  103. });