Fork me on GitHub
#cljsrn
<
2018-03-29
>
pesterhazy10:03:18

Does anyone have experience with accessing a ReactNative Image from a local location?

pesterhazy10:03:57

I'm familiar with static resources (using require), http/s URLs, as well as data: urls

pesterhazy10:03:34

But I need some way to access images from device storage or in some other way from native code

Oleh K.12:03:43

@pesterhazy when you select image with react-native-image-picker you can see local uri

pesterhazy12:03:28

@okilimnik excellent idea, let me try that

Oleh K.13:03:03

@pesterhazy I've never used this one. I think uris should be the same on ios, but react-native-image-picker works on android too

pesterhazy13:03:30

I'll give the one that ships with RN a try first

pesterhazy13:03:31

@okilimnik do you know off the top of your head what kind of url you get?

pesterhazy13:03:43

file:// or content:// or something else?

Oleh K.13:03:37

from react-native-image-picker docs: On iOS, don't assume that the absolute uri returned will persist. See #107

pesterhazy13:03:49

wait does this mean that I can just do <Image source={{uri: "/tmp/logo.png"}}> and it'll just work?

Oleh K.13:03:51

seems, yes