app.config.ts 2.7 KB

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