kevinresol / react-native-sound-recorder

Simplest Sound Recorder for React Native
MIT License
119 stars 36 forks source link

FIX: adding .reset() #11

Closed geniuscd closed 6 years ago

geniuscd commented 6 years ago

FIX: adding .reset() method before release on android only. prepanding the 'file://' to the path return from android only

kevinresol commented 6 years ago

I don't see how the file:// prefix affects #10 , it is just a return value after all. Can you revert that?

geniuscd commented 6 years ago

on android, you have to add the 'file://' to the path or you won't be able to locate it. so indeed when the file is saved in the cache, and we want to read it, we have to use the file:// otherwise, the error in #10 will appear.

kevinresol commented 6 years ago

You should add the file:// prefix in your own js code.

geniuscd commented 6 years ago

Why inserting Platform.OS just to do the following. on android every time you need to read a file you should use the file:// prefix. so why not add it to the android.java file and in the .JS code we don't have to add it every time. That's my thought.

kevinresol commented 6 years ago

Not always. For example I use react-native-fetch-blob and I feed the path as-is. So far I haven't needed a path that is prefixed with file://

kevinresol commented 6 years ago

And if you really need a reason: this is a breaking change for people who have prepended the prefix manually. I have not planned to break the library at the moment. I appreciate your contribution, but please remove the prefix.

kevinresol commented 6 years ago

Thanks