diff --git a/app.json b/app.json index 3e2d921..315ea13 100644 --- a/app.json +++ b/app.json @@ -16,7 +16,6 @@ "ios": { "supportsTablet": true, "bundleIdentifier": "com.imex.imexmobile", - "googleServicesFile": "./GoogleService-Info.plist", "entitlements": { "aps-environment": "development" @@ -29,7 +28,6 @@ }, "android": { "package": "com.imex.imexmobile", - "googleServicesFile": "./google-services.json", "permissions": [ "android.permission.READ_EXTERNAL_STORAGE", @@ -89,7 +87,16 @@ } ], "expo-localization", - "expo-font" + "expo-font", + [ + "expo-build-properties", + { + "android": { + "minSdkVersion": 25 + } + } + ], + "@logrocket/react-native" ] } } diff --git a/components/screen-main/screen-main.component.jsx b/components/screen-main/screen-main.component.jsx index b0acc6b..8efcb40 100644 --- a/components/screen-main/screen-main.component.jsx +++ b/components/screen-main/screen-main.component.jsx @@ -27,6 +27,8 @@ import ScreenSettingsComponent from "../screen-settings/screen-settings.componen import ScreenSignIn from "../screen-sign-in/screen-sign-in.component"; import ScreenSplash from "../screen-splash/screen-splash.component"; import { SplitFactory } from "@splitsoftware/splitio-react-native"; +import * as Updates from 'expo-updates'; +import LogRocket from '@logrocket/react-native'; const ActiveJobStack = createNativeStackNavigator(); const MoreStack = createNativeStackNavigator(); @@ -161,6 +163,13 @@ export function ScreenMainComponent({ checkUserSession(); }, [checkUserSession]); + useEffect(() => { + LogRocket.init('idt6oy/imex-mobile', { + updateId: Updates.isEmbeddedLaunch ? null : Updates.updateId, + expoChannel: Updates.channel, + }); + }, []); + useEffect(() => { if (bodyshop && bodyshop.imexshopid) { splitClient = SplitFactory({ diff --git a/package-lock.json b/package-lock.json index d8b0fa3..2f8f723 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,6 +11,7 @@ "@apollo/client": "^3.12.11", "@babel/preset-env": "7.26.8", "@expo/vector-icons": "^14.0.4", + "@logrocket/react-native": "^1.52.2", "@react-native-async-storage/async-storage": "1.23.1", "@react-native-community/cli-debugger-ui": "^15.1.3", "@react-native-community/datetimepicker": "8.2.0", @@ -28,6 +29,7 @@ "expo": "~52.0.46", "expo-application": "~6.0.2", "expo-av": "~15.0.2", + "expo-build-properties": "~0.13.3", "expo-constants": "~17.0.5", "expo-dev-client": "~5.0.20", "expo-device": "~7.0.3", @@ -5099,6 +5101,23 @@ "@jridgewell/sourcemap-codec": "^1.4.14" } }, + "node_modules/@logrocket/react-native": { + "version": "1.52.2", + "resolved": "https://registry.npmjs.org/@logrocket/react-native/-/react-native-1.52.2.tgz", + "integrity": "sha512-5feLSonnPhr1zdExwknY28nvrr1dw6XsUGqx9OdEArsM/CTDaQaSXwXg+B3nj8VVCcCje8Ihc7ZgiboPJAEUtw==", + "license": "MIT", + "peerDependencies": { + "expo": ">=45.0.0", + "expo-build-properties": "*", + "react": "*", + "react-native": ">=0.60.0-rc.0 <1.0.x" + }, + "peerDependenciesMeta": { + "expo": { + "optional": true + } + } + }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", @@ -9354,6 +9373,53 @@ } } }, + "node_modules/expo-build-properties": { + "version": "0.13.3", + "resolved": "https://registry.npmjs.org/expo-build-properties/-/expo-build-properties-0.13.3.tgz", + "integrity": "sha512-gw7AYP+YF50Gr912BedelRDTfR4GnUEn9p5s25g4nv0hTJGWpBZdCYR5/Oi2rmCHJXxBqhPjxzV7JRh72fntLg==", + "license": "MIT", + "dependencies": { + "ajv": "^8.11.0", + "semver": "^7.6.0" + }, + "peerDependencies": { + "expo": "*" + } + }, + "node_modules/expo-build-properties/node_modules/ajv": { + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz", + "integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==", + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.3", + "fast-uri": "^3.0.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/expo-build-properties/node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "license": "MIT" + }, + "node_modules/expo-build-properties/node_modules/semver": { + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.2.tgz", + "integrity": "sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA==", + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/expo-constants": { "version": "17.0.8", "resolved": "https://registry.npmjs.org/expo-constants/-/expo-constants-17.0.8.tgz", @@ -9933,6 +9999,22 @@ "resolved": "https://registry.npmjs.org/fast-loops/-/fast-loops-1.1.3.tgz", "integrity": "sha512-8EZzEP0eKkEEVX+drtd9mtuQ+/QrlfW/5MlwcwK5Nds6EkZ/tRzEexkzUY2mIssnAyVLT+TKHuRXmFNNXYUd6g==" }, + "node_modules/fast-uri": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.0.6.tgz", + "integrity": "sha512-Atfo14OibSv5wAp4VWNsFYE1AchQRTv9cBGWET4pZWHzYshFSS9NQI6I57rdKn9croWVMbYFbLhJ+yJvmZIIHw==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "BSD-3-Clause" + }, "node_modules/fastq": { "version": "1.17.1", "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", diff --git a/package.json b/package.json index bde94ed..d38de96 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,7 @@ "@apollo/client": "^3.12.11", "@babel/preset-env": "7.26.8", "@expo/vector-icons": "^14.0.4", + "@logrocket/react-native": "^1.52.2", "@react-native-async-storage/async-storage": "1.23.1", "@react-native-community/cli-debugger-ui": "^15.1.3", "@react-native-community/datetimepicker": "8.2.0", @@ -36,12 +37,14 @@ "expo": "~52.0.46", "expo-application": "~6.0.2", "expo-av": "~15.0.2", + "expo-build-properties": "~0.13.3", "expo-constants": "~17.0.5", "expo-dev-client": "~5.0.20", "expo-device": "~7.0.3", "expo-file-system": "~18.0.10", "expo-font": "~13.0.3", "expo-image-manipulator": "~13.0.6", + "expo-image-picker": "~16.0.6", "expo-images-picker": "^2.5.1", "expo-localization": "~16.0.1", "expo-media-library": "~17.0.6", @@ -89,8 +92,7 @@ "redux-logger": "^3.0.6", "redux-persist": "^6.0.0", "redux-saga": "^1.3.0", - "reselect": "^5.1.1", - "expo-image-picker": "~16.0.6" + "reselect": "^5.1.1" }, "devDependencies": { "@babel/core": "^7.26.8", diff --git a/util/document-upload.utility.js b/util/document-upload.utility.js index e95fbec..34825d4 100644 --- a/util/document-upload.utility.js +++ b/util/document-upload.utility.js @@ -18,13 +18,13 @@ export const handleUpload = async (ev, context) => { const { mediaId, onError, onSuccess, onProgress } = ev; const { bodyshop, jobId } = context; try { - const imageData = await MediaLibrary.getAssetInfoAsync(mediaId); + const imageUri = imageData.localUri || imageData.uri const newFile = await ( - await fetch(imageData.localUri || imageData.uri) + await fetch(imageUri) ).blob(); - let extension = imageData.localUri.split(".").pop(); + let extension = imageData.filename.split(".").pop(); //Default to Cloudinary in case of split treatment errors. let destination = @@ -33,10 +33,10 @@ export const handleUpload = async (ev, context) => { let key = destination === "imgproxy" ? `${bodyshop.id}/${jobId}/${replaceAccents( - imageData.filename || imageData.uri.split("/").pop() + imageData.filename || imageUri.split("/").pop() ).replace(/[^A-Z0-9]+/gi, "_")}-${new Date().getTime()}.${extension}` : `${bodyshop.id}/${jobId}/${( - imageData.filename || imageData.uri.split("/").pop() + imageData.filename || imageUri.split("/").pop() ).replace(/\.[^/.]+$/, "")}-${new Date().getTime()}`; const res = @@ -82,14 +82,14 @@ export const handleUpload = async (ev, context) => { export const handleUploadImgproxy = async (ev, context) => { const { mediaId, onError, onSuccess, onProgress } = ev; const { bodyshop, jobId } = context; - const imageData = await MediaLibrary.getAssetInfoAsync(mediaId); + const imageUri = imageData.localUri || imageData.uri const newFile = await ( - await fetch(imageData.localUri || imageData.uri) + await fetch(imageUri) ).blob(); - let extension = imageData.localUri.split(".").pop(); + let extension = imageUri.split(".").pop(); let key = `${bodyshop.id}/${jobId}/${( - imageData.filename || imageData.uri.split("/").pop() + imageData.filename || imageUri.split("/").pop() ).replace(/\.[^/.]+$/, "")}-${new Date().getTime()}`; const res = await uploadToImgproxy( @@ -158,6 +158,7 @@ export const uploadToImgproxy = async ( xhr.setRequestHeader("Content-Type", fileType); xhr.upload.onprogress = (event) => { + console.log("*** ~ awaitnewPromise ~ event:", event); if (onProgress && event.lengthComputable) { onProgress({ percent: event.loaded / event.total, loaded: event.loaded }); } @@ -171,7 +172,7 @@ export const uploadToImgproxy = async ( } }; - xhr.onerror = () => { + xhr.onerror = (req, event) => { reject(new Error("Network error")); };