osamaqarem/react-native-image-colors

Error in fetching the image

codeyogi911 opened this issue · 5 comments

On android getting the colour is failing with the below trace:

Error: ImageColors: https://mobile-a5b2257ca.hana.ondemand.com/mobilemediaimage/ImageSet(Objecttype='KLAH',Objectkey='MYM_L5',Doctype='B0')/$value
at Object.promiseMethodWrapper [as getColors] (NativeModules.js:103)
at Object.getColors (index.js:8)
at eval (VM6 RootHierarchyNode.bundle:62)
at commitHookEffectListMount (ReactNativeRenderer-dev.js:15561)
at commitPassiveHookEffects (ReactNativeRenderer-dev.js:15618)
at Object.invokeGuardedCallbackImpl (ReactNativeRenderer-dev.js:265)
at invokeGuardedCallback (ReactNativeRenderer-dev.js:476)
at flushPassiveEffectsImpl (ReactNativeRenderer-dev.js:18795)
at unstable_runWithPriority (scheduler.development.js:653)
at runWithPriority (ReactNativeRenderer-dev.js:5268)

The image is not public but the same link works when given like and the image loads perfectly:
<Image source={{uri: 'https://mobile-a5b2257ca.hana.ondemand.com/mobilemediaimage/ImageSet(Objecttype='KLAH',Objectkey='MYM_L5',Doctype='B0')/$value')}} />

The image is not public but the same link works when given like and the image loads perfectly:
<Image source={{uri: 'https://mobile-a5b2257ca.hana.ondemand.com/mobilemediaimage/ImageSet(Objecttype='KLAH',Objectkey='MYM_L5',Doctype='B0')/$value')}} />

Sorry, this doesn't seem to work for me. The <Image /> does not load. Could you clarify?

Closing due to no response.

Hello,
The image has required the user to be authenticated to be displayed.

So the issue is: On iOS, the library somehow uses the standard network protocols to make requests.
But on Android, it requests images using a separate client. That's why it should require an Authorization header. What do you suggest for this?

I will see what I can do when I find some time. If you are in a rush you can download the image and save it to a file ahead of time and pass the file URI to ImageColors instead.