app.config.ts 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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: '1.0.0',
  19. // Should be updated after every dependency change
  20. runtimeVersion: '1.4',
  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/splash.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. },
  84. plugins: [
  85. [
  86. 'expo-image-picker',
  87. {
  88. photosPermission: 'Allow NomadMania.com access to your photo library to upload photos.',
  89. cameraPermission: 'Allow NomadMania.com access to your camera to upload photos directly.'
  90. }
  91. ]
  92. ]
  93. });