You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The physical device I'm testing is android version 10 and when I debug the app with cable in android studio, below code works fine, every file was sent to api with multipart form data. However, when I release this app and test it on the same physical device, empty array was sent to api. Can anyone explain what is happening between debug/developer mode vs release build?
My target sdk version is 33.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
The physical device I'm testing is android version 10 and when I debug the app with cable in android studio, below code works fine, every file was sent to api with multipart form data. However, when I release this app and test it on the same physical device, empty array was sent to api. Can anyone explain what is happening between debug/developer mode vs release build?
My target sdk version is 33.
permission.storagePermission() .then(() => DocumentPicker.pick() .then(async (res) => { let formData = new FormData(); let filePath if (res[0]?.uri.includes("content:/")) { const urlComponents = res[0]?.uri.split('/') const fileNameAndExtension = urlComponents[urlComponents.length - 1] const destPath = '${RNFS.TemporaryDirectoryPath}/${fileNameAndExtension}' await RNFS.copyFile(res[0]?.uri, destPath) filePath = 'file://' + destPath } else { let FullFilePath = res[0]?.uri filePath = encodeURI(FullFilePath) } formData.append('file', { uri: filePath, name: res[0]?.name, type: res[0]?.type, }); requestPostApi(formData) }) .catch(err => console.log(err, "Picker Handler...err")) )
Beta Was this translation helpful? Give feedback.
All reactions