瀏覽代碼

Merge branch 'sdk-config' of SashaGoncharov19/nomadmania-app into dev

Viktoriia 1 年之前
父節點
當前提交
1f25820dad
共有 5 個文件被更改,包括 28 次插入8 次删除
  1. 11 3
      app.config.ts
  2. 3 2
      package.json
  3. 2 2
      src/components/MenuDrawer/index.tsx
  4. 2 0
      src/constants/secrets.ts
  5. 10 1
      src/utils/request.ts

+ 11 - 3
app.config.ts

@@ -19,9 +19,9 @@ export default ({ config }: ConfigContext): ExpoConfig => ({
   owner: 'nomadmaniaou',
   scheme: 'nm',
   // Should be updated after every production release (deploy to AppStore/PlayMarket)
-  version: '1.0.0',
+  version: '2.0.0',
   // Should be updated after every dependency change
-  runtimeVersion: '1.4',
+  runtimeVersion: '1.5',
   orientation: 'portrait',
   icon: './assets/icon.png',
   userInterfaceStyle: 'light',
@@ -92,6 +92,14 @@ export default ({ config }: ConfigContext): ExpoConfig => ({
         photosPermission: 'Allow NomadMania.com access to your photo library to upload photos.',
         cameraPermission: 'Allow NomadMania.com access to your camera to upload photos directly.'
       }
-    ]
+    ],
+    [
+      "expo-build-properties",
+      {
+        android: {
+          minSdkVersion: 33
+        }
+      }
+    ],
   ]
 });

+ 3 - 2
package.json

@@ -1,6 +1,6 @@
 {
   "name": "nomadmania-app",
-  "version": "1.0.0",
+  "version": "2.0.0",
   "main": "node_modules/expo/AppEntry.js",
   "scripts": {
     "start": "expo start --dev-client",
@@ -64,7 +64,8 @@
     "react-native-tab-view": "^3.5.2",
     "react-native-walkthrough-tooltip": "^1.6.0",
     "yup": "^1.3.3",
-    "zustand": "^4.4.7"
+    "zustand": "^4.4.7",
+    "expo-build-properties": "~0.8.3"
   },
   "devDependencies": {
     "@babel/core": "^7.20.0",

+ 2 - 2
src/components/MenuDrawer/index.tsx

@@ -14,7 +14,7 @@ import MailIcon from '../../../assets/icons/mail.svg';
 import DocumentIcon from '../../../assets/icons/document.svg';
 import ExitIcon from '../../../assets/icons/exit.svg';
 import UserXMark from '../../../assets/icons/user-xmark.svg';
-import { FASTEST_MAP_HOST } from 'src/constants';
+import { APP_VERSION, FASTEST_MAP_HOST } from 'src/constants';
 
 export const MenuDrawer = (props: any) => {
   const { mutate: deleteUser } = useDeleteUserMutation();
@@ -99,7 +99,7 @@ export const MenuDrawer = (props: any) => {
               }
             />
             <View style={{ gap: 6, marginTop: 16 }}>
-              <Text style={styles.bottomText}>Version 2.0</Text>
+              <Text style={styles.bottomText}>Version {APP_VERSION}</Text>
               <Text style={styles.bottomText}>
                 Map server:{'\n'}
                 {FASTEST_MAP_HOST}

+ 2 - 0
src/constants/secrets.ts

@@ -12,3 +12,5 @@ export let FASTEST_MAP_HOST: string = MAP_HOST;
 export const setFastestMapHost = (server: string | null) => {
   FASTEST_MAP_HOST = server ?? MAP_HOST;
 };
+
+export const APP_VERSION = Constants?.expoConfig?.version ?? Constants?.manifest?.version;

+ 10 - 1
src/utils/request.ts

@@ -1,6 +1,15 @@
 import axios from 'axios';
-import { API_URL } from '../constants';
+import { API_URL, APP_VERSION } from '../constants';
+import { Platform } from 'react-native';
 
 export const request = axios.create({
   baseURL: API_URL
 });
+
+request.interceptors.request.use(config => {
+  config.headers['App-Version'] = APP_VERSION;
+  config.headers['Platform'] = Platform.OS;
+  return config;
+}, error => {
+  return Promise.reject(error);
+});