Blob content provider support in Android

Hi there,

In our detached project, we’re working with a dependency that uses the Blob RN API with Android content providers.

The thing is that I see there is no support to the Blob module on Expo apps, it this something you’re aware of?

Digging in the RN code I found that in the React Native BlobProvider’s class they have this check. Which is triggering the exception since context is an instance of ExpoApplicationMultidexApplication.

The following is the error we’re having:

Is there any workaround to this, or we may find another alternative to how we’re handling blobs?

EDIT: Well, as a workaround I found that creating a custom content provider can do the trick. Once I get it working properly, I’ll share a sample here.

Thanks in advance!

2 Likes

To support blob content provider on detached our Expo app, I’ve modified the React Native BlobProvider to use a different ReactApplicationContext.

In here you can find a Gist with the workaround

Note: The way I’ve provided the context instance it doesn’t seem like the right one, but didn’t found any other alternative. I saw there is a NativeModuleDepsProvider but didn’t managed to inject a context instance from it, I would need some guidance from the Expo devs for this :sweat_smile:

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.