alpha0010 / react-native-file-access

Filesystem access for React Native
MIT License
298 stars 18 forks source link

Add a fallback for cpAsset resource type #68

Closed meypod closed 1 year ago

meypod commented 1 year ago

Hi currently I'm trying to copy a raw resource, but cpAsset does not find the resource: but I managed to get the resourceId on android studio debugger by using "raw" on this line: https://github.com/alpha0010/react-native-file-access/blob/3c1672568a5da6d8e6c9b12672b785b1e310b4a4/android/src/main/java/com/alpha0010/fs/FileAccessModule.kt#L122

can you add a retry to try to get the resource id again by using "raw" there ?

alpha0010 commented 1 year ago

Did you use 'raw/file.txt', or just 'file.txt'? It should work with the type/ prefix in the name.

See example: https://github.com/alpha0010/react-native-file-access/blob/master/example/src/App.tsx#L48-L52

meypod commented 1 year ago

well I never knew that I could do that I'll try It would be nice to add to the readme

meypod commented 1 year ago

It seems that it works