We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9ddd845 commit e1c4181Copy full SHA for e1c4181
android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java
@@ -59,6 +59,7 @@
59
import org.json.JSONObject;
60
import org.json.JSONTokener;
61
62
+import java.io.File;
63
import java.lang.reflect.InvocationTargetException;
64
import java.lang.reflect.Method;
65
import java.util.ArrayList;
@@ -457,8 +458,10 @@ public void setVideoRecordingFloatingButtonPosition(String corner) {
457
458
@ReactMethod
459
public void setFileAttachment(String fileUri, String fileNameWithExtension) {
460
try {
- Uri uri = Uri.parse(fileUri);
461
- Instabug.addFileAttachment(uri, fileNameWithExtension);
+ File file = new File(fileUri);
462
+ if (file.exists()) {
463
+ Instabug.addFileAttachment(Uri.fromFile(file), fileNameWithExtension);
464
+ }
465
} catch (Exception e) {
466
e.printStackTrace();
467
}
0 commit comments