Browse Source

Revert "Fix the Android implementation to return a file path, not an Uri path"

I was actually wrong on this.

Fixes #15

my problem i was having is you can't do new File(uri) but it's normal, it's not a file path, it's a Uri,
if you are sure you have a file uri, you can do new File(Uri.parse(uri).getPath()) but I guess best is to get a input stream from the Uri or keep using Uri..

This reverts commit a85cf9629a.
Gaëtan Renaudeau 8 years ago
parent
commit
70318c2c22

+ 2
- 1
android/src/main/java/fr/greweb/reactnativeviewshot/ViewShot.java View File

67
             if ("file".equals(result)) {
67
             if ("file".equals(result)) {
68
                 os = new FileOutputStream(output);
68
                 os = new FileOutputStream(output);
69
                 captureView(view, os);
69
                 captureView(view, os);
70
-                promise.resolve(output.getAbsolutePath());
70
+                String uri = Uri.fromFile(output).toString();
71
+                promise.resolve(uri);
71
             }
72
             }
72
             else if ("base64".equals(result)) {
73
             else if ("base64".equals(result)) {
73
                 os = new ByteArrayOutputStream();
74
                 os = new ByteArrayOutputStream();